小编cod*_*tie的帖子

如何在缩小父级时显示内联块而不在新行上断开它们

我在容器中有2列(内联块)(100%宽度).

  1. 左侧列必须具有最小宽度,例如200px,宽度:25%.

  2. 右侧柱宽:75%

    <style>
    .outer {
        width: 100%;
        border: 1px solid black;
    }
    .left, .right {
        display:inline-block;
    }
    .left {
        min-width: 200px;
        width: 25%;
        background-color: #dcc2c2;
    }
    .right {
        width: 75%;
        background-color: #d0dee8;
    }
    </style>
    
        <div class="outer">
            <div class="left">left</div>
            <div class="right">right</div>
        </div>
    
    Run Code Online (Sandbox Code Playgroud)

在调整大小时达到最小宽度之前,列并排放置,这是我想要的,但是一旦最小宽度开始,右列就会落在下一行.

如何使正确的列缩小但不会落在下一行?

链接到JSFiddle

html css width

30
推荐指数
2
解决办法
3万
查看次数

标签 统计

css ×1

html ×1

width ×1