【问题标题】:justify-content is not applying in chakra uijustify-content 不适用于脉轮 ui
【发布时间】:2022-02-24 08:44:08
【问题描述】:

我正在使用 Next.js 和 Chakra-ui 开发一个网站。在这里,我试图将 ButtonGroup 对齐到末尾。为此,我正在尝试使用justifyContent="space-between",但它不起作用。 这是卡片组件的代码

            <Flex direction="column" px={0} justifyContent="space-between">
                <Flex px={10} pt={10} direction="column" lineHeight="7" mb={5}>
                    <Heading size="sm">{data.name}</Heading>
                    <UnorderedList mt={5}>
                        {data.features.map((element, index) => (<ListItem key={index} fontSize="13px">{element}</ListItem>))}
                    </UnorderedList>
                </Flex>
                <ButtonGroup spacing="0">
                    <Button w="100%" m={0} borderRadius="0 0 0 20px" fontSize="14px">
                        Explore More
                    </Button>
                    <Button
                        w="100%"
                        color="white"
                        bg="#274E85"
                        m={0}
                        borderRadius="0 0 20px 0"
                        fontSize="14px"
                    >
                        Apply Now
                    </Button>
                </ButtonGroup>

            </Flex>

请有人帮我解决这个问题

【问题讨论】:

  • 将 flexGrow=1 添加到主 flex 中,或尝试 height: 100%

标签: reactjs flexbox next.js chakra-ui


【解决方案1】:

您不应使用justifyContent,而应仅使用justify

【讨论】:

    猜你喜欢
    • 2021-05-17
    • 2021-01-29
    • 2020-11-15
    • 1970-01-01
    • 2019-11-17
    • 1970-01-01
    • 2016-04-24
    • 2021-07-30
    • 1970-01-01
    相关资源
    最近更新 更多