溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

CSS雙飛翼布局

發(fā)布時間:2020-07-27 16:10:16 來源:網(wǎng)絡(luò) 閱讀:378 作者:anyw3c 欄目:web開發(fā)

--
此CSS是為了實現(xiàn)三列布局:左右固定,中間自適應(yīng);且瀏覽器會自上而下先出現(xiàn)中間部分。

html:

<body>
<!-- 使得瀏覽器先出來center -->
<div class="box">
    <div class="center">
        <!-- 創(chuàng)建一個div 開造 -->
        <div class="inner"></div>
    </div>
    <div class="left"></div>
    <div class="right"></div>
</div>

</body>


CSS:

<style>
    .box {
        width: 100%;
        height: 300px;
        background: darkblue;
        margin: 0 auto;
    }

    .center {
        width: 100%;
        height: 100%;
        float: left;
    }

    .inner {
        /* width: 100px;
        height: 100%;
        background: darkmagenta; */
        margin: 0;
    }

    .left {
        width: 100px;
        height: 100%;
        background: darkgoldenrod;
        float: left;
        margin-left: -100%;
    }

    .right {
        width: 100px;
        height: 100%;
        background: darkred;
        float: left;
        margin-left: -100px;
    }
</style>

最后效果出來是這樣的
CSS雙飛翼布局

據(jù)說認(rèn)真閱讀并點贊的你,代碼敲的最6哦~ 有興趣的小伙伴可以加我微信,一起討論;V-x: dandanshen987

##有一天,當(dāng)你明白"小白" +"勤奮"的時候,你就會成為大牛##

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI