html代码问题,使上面图放在背景上,请大神帮忙,谢谢
html吧
全部回复
仅看楼主
level 1
3336083 楼主
<!DOCTYPE html>
<html>
<head>
<title>嘉</title>
<style type="text/css">
html, body {color:#222; font-family:Microsoft YaHei, Helvitica,
Verdana, Tohoma, Arial, san-serif; margin:0; padding: 0; text-
decoration: none; }
img { border:0; }
ul { list-style: none outside none; margin:0; padding: 0; }
body {
background-color:#eee;
}
body .mainmenu:after { clear: both; content: " "; display: block; }
body .mainmenu li{
float:left;
margin-left: 2.5%;
margin-top: 1%;
width: 200px;
border-radius:5px;
overflow:hidden;
}
body .mainmenu li a{ display:block; color:#FFF; text-
align:center }
body .mainmenu li a b{
display:block; height:100px;
}
body .mainmenu li a img{
margin: 0px auto -3px;
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div align=center ; style="position:absolute; left:0px; top:0px;
width:100%; height:100%">
<ul class="mainmenu">
<table border=0 frame=void >
<tr>
<td><li><a href="#" ><img src="img/EIN_N.png" alt="敬请期
待"/></a></li></td>
<td><li><a href="#" ><img src="img/IBUDU_N.png" alt="敬请期
待"/></a></li></td>
<td><li><a href="#" ><img src="img/MIDI_N.png" alt="敬请期
待"/></a></li></td>
</tr>
</table></ul>
<img src="img/bg2.jpg" width="100%" height="100%"/> </div>
</body>
</html>
2017年12月16日 06点12分 1
level 1
3336083 楼主
图片放在背景上,求助
2017年12月16日 06点12分 2
level 6
小图片给一个绝对定位,position:absolute
或者在样式里面直接添加背景图片就不会出现这种情况了。
2017年12月16日 07点12分 3
level 1
3336083 楼主
已解决,谢谢
2017年12月20日 03点12分 4
1