您好,登錄后才能下訂單哦!
--
此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>
最后效果出來是這樣的
據(jù)說認(rèn)真閱讀并點贊的你,代碼敲的最6哦~ 有興趣的小伙伴可以加我微信,一起討論;V-x: dandanshen987
##有一天,當(dāng)你明白"小白" +"勤奮"的時候,你就會成為大牛##
免責(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)容。