為什么我已經初始化了,背景圖片還是和div有點間隙啊????????求大神指導!?。?!
<!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">
*{margin:0;padding:0}
img{margin:20px 40px;border:2px solid #F00;}
.book{background:url(2.jpg) no-repeat #6FF;}
.content{border:4px solid #0FF}
</style>
</head>
<body>
<div class="content book">
<img src="Blue hills.jpg"width="80px"height="80px" />
<img src="Sunset.jpg"width="80px"height="80px" />
<img src="Water lilies.jpg"width="80px"height="80px" />
<img src="Winter.jpg"width="80px"height="80px" />
</div>
</body>
</html>
!
2016-07-26
<!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"> *{margin:0;padding:0} img{margin:20px?40px;border:2px?solid?#F00;} .book{background:url(2.jpg)?no-repeat?#6FF;} /*?.content{border:4px?solid?#0FF}?*/?/*?是設置了邊框的原因,注釋掉,就沒有間隙了。?*/? </style> </head> <body> <div?class="content?book"> <img?src="Blue?hills.jpg"width="80px"height="80px"?/> <img?src="Sunset.jpg"width="80px"height="80px"?/> <img?src="Water?lilies.jpg"width="80px"height="80px"?/> <img?src="Winter.jpg"width="80px"height="80px"?/> </div> </body> </html>