<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>? ? <title></title>? ? <style type="text/css">? ? ? ? h3{font-size:18px;}? ? ? ? .box{width:300px;? ? ? ? ? ? border-left:300px solid #0026ff;? ? ? ? ? ? ?background:#808080? ? ? ? }? ? ? ? .left{margin-left:-300px;? ? ? ? ? ? ?? ? ? ? ? ? ?? ? ? ? }? ? ? ??? ? </style></head><body><div class="box">? ? <nav class="left">? ? ? ? <h3>導(dǎo)航</h3>? ? </nav>? ? <section>? ? ? ? <div class="module">模塊</div>? ? ? ? <div class="module">模塊</div>? ? ? ? <div class="module">模塊</div>? ? ? ? <div class="module">模塊</div>? ? </section>? ?? ??</div>? ??</body></html>
3 回答
已采納

賣(mài)火柴的小老鼠
TA貢獻(xiàn)3條經(jīng)驗(yàn) 獲得超5個(gè)贊
你按f12打開(kāi)調(diào)試工具,你會(huì)發(fā)現(xiàn)h3的寬度是在這個(gè)模塊四個(gè)字上面的,所以這四個(gè)模塊就在下面。看這張圖

Mosaic被占用了
TA貢獻(xiàn)5條經(jīng)驗(yàn) 獲得超2個(gè)贊
這是因?yàn)椤皩?dǎo)航”占據(jù)了一行,你在 .left{} 中設(shè)置添加右浮動(dòng):float:left;

添加回答
舉報(bào)
0/150
提交
取消