<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>無標(biāo)題文檔</title><style>.box{width:200px; margin:30px auto;}.boxHead{ background:url(headbackT.jpg) repeat-x; height:9px; overflow:hidden;}.boxHeadL{ background: url(headl.jpg) no-repeat;}.boxHeadR{ background: url(headbackr.jpg) no-repeat right:0; height:9px;}</style></head><body><div class="box"><div class="boxHead"><div class="boxHeadL"><div class="boxHeadR"></div></div></div></div></body></html>
1 回答
已采納

阿賈大魔王
TA貢獻(xiàn)29條經(jīng)驗(yàn) 獲得超28個贊
你難道不覺得你的框架有問題嗎?他們的關(guān)系不應(yīng)該是這樣嗎:
<div?class="box"> ??<div?class="boxHeadL"></div> ??<div?class="boxHead"></div> ??<div?class="boxHeadR"></div> </div>
你那樣一個包含一個的是什么鬼。
給每個div設(shè)置你需要的寬高,不要有的設(shè)了有的沒設(shè),很不規(guī)范;然后左浮動:float:left。
.box{width:200px;?margin:30px?auto;} .boxHead{height:9px;?width:160px;?overflow:hidden;?background:#000;?float:left} .boxHeadL{height:9px;?width:20px;?background:#F06;?float:left} .boxHeadR{height:9px;?width:20px;?background:#09C;?float:left}
你想要邊框圓角可以用border-radius:*px,不過兼容性差一些,在ie依然是直角
點(diǎn)擊展開后面2條
添加回答
舉報
0/150
提交
取消