【问题标题】:My class flex wrap is not apply to div item我的类 flex wrap 不适用于 div 项
【发布时间】:2023-03-19 23:05:01
【问题描述】:

Flex wrap 没什么问题,我的代码是这样的:

<!DOCTYPE html>
<html>

<head>

    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.8.0/css/bulma.min.css">
    <script defer src="https://use.fontawesome.com/releases/v5.3.1/js/all.js"></script>
</head>

<body>
    <section class="section">
        <div class="container">
            <div class="card">

                <div class="card-content">
                    <div class="content">
                        <div class="box">
                            <div id="mr">
                                <div class="item " id="1">1</div>
                                <div class="item " id="2">2</div>
                                <div class="item " id="3">3</div>
                            </div>

                        </div>

                    </div>

                </div>

            </div>

        </div>

    </section>

还有 CSS

.item {
    height: 50px;
    width: 50px;
    border-radius: 1rem;
    margin: 1rem .5rem;
    background: #53d5bb;
    color: rgba(255, 255, 255, 0.45);
    -webkit-box-shadow: 0 2px 20px 0 rgba(0, 0, 0, 0.05);
    box-shadow: 0 2px 20px 0 rgba(0, 0, 0, 0.05);
    text-align: center;
    line-height: 50px;
    font-size: 1rem;
}

#mr {
    display: flex;
    flex-wrap: wrap-reverse;
}

.box {
    height: 400px;
}

我做错了什么?这可能取决于 Bulma CSS 还是我错过了什么?为什么这个类 flex-wrap: wrap-reverse; 不起作用?另外,这是我的小提琴https://jsfiddle.net/kv3gfs4r/1/

【问题讨论】:

    标签: html css flexbox bulma


    【解决方案1】:

    它有效。当您调整窗口大小并且容器不完全可见时,它可以正常工作。我会说它从底部开始并包裹到顶部,所以当需要包裹时,它只是从底部到顶部写入。

    当然有flex-direction: row-reverse 会颠倒每个元素的顺序。

    请参考您要完成的任务。

    【讨论】:

      猜你喜欢
      • 2021-03-26
      • 2019-01-31
      • 2013-07-15
      • 2022-01-12
      • 2020-11-23
      • 2017-12-03
      • 2021-02-05
      • 1970-01-01
      • 2022-01-02
      相关资源
      最近更新 更多