<!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 type="text/css">*{margin:0;padding:0;} ?/*除去網(wǎng)頁內(nèi)各種標(biāo)簽的默認邊距*/ ? /*高度按子元素尺寸撐開*/#wrap{ width:1000px; ?/*長度如何計算??????????????????在360和在ie中不一樣*/ margin:0 auto;}#header{ height:100px; background-color:#CCC;}#mainbody{ height:700px; background-color:#FF0;}#footer{ height:60px; background-color:#CCC;}.content{ border:7px #B7DBDB solid; padding:60px 15px 25px 15px;}.book{ background: url(../t_book1.gif) no-repeat #F2F7FB ; ?/*圖片沒有設(shè)置坐標(biāo)。默認從左上角開始*/? ? /*背景顏色在此設(shè)置,不要在content設(shè)置*/ }img{ margin:0 20px; border:3px #CCCCCC solid;}</style></head><body><div id="wrap">? <div id="header"></div>? <div id="mainbody">? ? <div class="content book"> ? ?<!--content為框架樣式、book為背景樣式-->? ? ? <img src="../book1.jpg" width="110" height="100" />? ? ? <img src="../book2.jpg" width="110" height="100" />? ? ? <img src="../book3.jpg" width="110" height="100" />? ? ? <img src="../book4.jpg" width="110" height="100" />? ? ? <img src="../book5.jpg" width="110" height="100" />? ? ? <img src="../book6.jpg" width="110" height="100" />? ? </div>? </div>? <div id="footer"></div></div></body></html>
3 回答

逗你玩而已
TA貢獻38條經(jīng)驗 獲得超6個贊
沒啥問題,應(yīng)該是各種瀏覽器的兼容問題,別在ie9以下瀏覽器折騰,如果能貼出效果圖,可能會得到答案,#wrap寬度可以考慮85%,圖片width15%,然后再微調(diào)內(nèi)外邊距,個人喜歡用這種方式定義