网格模板:未获得固定宽度

时间:2020-10-19 08:45:06

标签: html css

是的,grid-template-columns在我开始添加内容时没有告诉每列固定宽度的有效原因是什么(尽管我告诉我了)。我有三列也想分配相同的宽度。因为我希望这是一个响应性网站,所以我将百分比指定为相对指标。

逻辑可能会决定我为台式机设备分配grid-template-columns:33.33333333%,但显然Dreamweaver不会将其分配给“逻辑”。

.index-placeholder{
        display: grid;
        grid-template-columns: 15% 75% 10%;
        grid-template-rows: auto;
        grid-template-areas: "customer__option__left customer__option__middle customer__option__right";
        grid-gap: 20px;
    }

    .customer__option__left{
        grid-area: customer__option__left;
    }
    
    .customer__option__middle{
        grid-area: customer__option__middle;
    }
    
    .customer__option__right{
        grid-area: customer__option__right;
    }
<div class="placeholder_center">
        <div class="index-placeholder">
            <a href="#" class="customer__option customer__option__left">
                content
            </a>
            <a href="#" class="customer__option customer__option__middle">
                content
            </a>
            <a href="#" class="customer__option customer__option__right">
             content content content content content content content content
            </a>
        </div>
    </div>

很好,没有内容,但是有了内容,宽度就适合了内容。

现在为什么?

0 个答案:

没有答案
相关问题