課程
/前端開發
/HTML/CSS
/網頁簡單布局之結構與表現原則
編程挑戰,為什么我的還有半透明的白色框
2016-10-12
源自:網頁簡單布局之結構與表現原則 3-3
正在回答
完整代碼,拿走不謝
<!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>圖片背景</title>
<style type="text/css">
body{ margin:0;}
div{background:#460E29;width:700px;padding:20px}
img{width:95px;height:95px;background:url(http://img1.sycdn.imooc.com//5385ac820001905201440133.jpg); padding:1px 20px 37px 30px;margin-right:10px;}
</style>
</head>
<body>
<div><img src="http://img1.sycdn.imooc.com//5385acb000013b0d00950095.jpg" />
? ? <img src="http://img1.sycdn.imooc.com//5385acb000013b0d00950095.jpg" />
? ? <img src="http://img1.sycdn.imooc.com//5385acb000013b0d00950095.jpg" /> </div>
</body>
</html>
margin:21px 30px 37px40px; ? ? ?float:left;
margin值設置的不夠精準,間距值計算少了
舉報
入門必殺技之結構與表現相分離,課程會有3個案例,不同角度講解
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2018-09-17
完整代碼,拿走不謝
<!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>圖片背景</title>
<style type="text/css">
body{ margin:0;}
div{background:#460E29;width:700px;padding:20px}
img{width:95px;height:95px;background:url(http://img1.sycdn.imooc.com//5385ac820001905201440133.jpg); padding:1px 20px 37px 30px;margin-right:10px;}
</style>
</head>
<body>
<div><img src="http://img1.sycdn.imooc.com//5385acb000013b0d00950095.jpg" />
? ? <img src="http://img1.sycdn.imooc.com//5385acb000013b0d00950095.jpg" />
? ? <img src="http://img1.sycdn.imooc.com//5385acb000013b0d00950095.jpg" />
? ? <img src="http://img1.sycdn.imooc.com//5385acb000013b0d00950095.jpg" /> </div>
</body>
</html>
2016-10-12
margin:21px 30px 37px40px; ? ? ?float:left;
2016-10-12
margin值設置的不夠精準,間距值計算少了