我知道这是一个非常简单的过程,但是每次我尝试完成此页面的设计时,我都会寻找答案,而我在这里和 Google 上找到的解决方案都没有为我解决问题。
我也明白强制一个元素居中并不理想,尤其是当现在有这么多不同的设备访问互联网时,但我只想完成这件事,以便我可以专注于其他问题。
这是代码:
<!DOCTYPE html>
<html>
<head>
<title>Como chegar</title>
<style>
#container {
width: 800px;
height: 600px;
margin: 100px auto;
}
#content {
width: 800px;
height: 500px;
background-color: white;
}
.strips {
width: 800px;
height: 50px;
background-image: url(spritepimentarosa.png);
background-repeat: no-repeat;
float: left;
}
.navBar {
width: 250px;
height: 50px;
background-image: url(spritepimentarosa.png);
background-repeat: no-repeat;
float: left;
}
.nb1 {
background-position: 0px -450px;
margin-left: 25px;
}
.nb2 {
background-position: -250px -450px;
}
.nb3 {
background-position: -500px -500px;
margin-right: 25px;
}
.nb1:hover {
background-position: 0px -500px;
margin-left: 25px;
}
.nb2:hover {
background-position: -250px -500px;
}
.nb3:hover {
background-position: -500px -450px;
margin-right: 25px;
}
.logo {
background-position: 0px -200px;
}
.footer {
background-position: 0px -400px;
}
</style>
</head>
<body bgcolor="#D63B77">
<div id="container"><!-- beginning of container -->
<div class="navBar nb1"></div>
<div class="navBar nb2"></div>
<div class="navBar nb3"></div>
<div id="content"><!-- beginning of content -->
<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.ie/maps?f=q&source=s_q&hl=en&geocode=&q=Avenida+S%C3%A3o+Camilo,+980,+Cotia+-+S%C3%A3o+Paulo,+Brazil&aq=0&oq=980,+avenida+sao+camilo&sll=-23.583184,-46.836844&sspn=92.879748,186.152344&t=m&ie=UTF8&hq=&hnear=Av.+S%C3%A3o+Camilo,+980+-+Cotia+-+S%C3%A3o+Paulo,+06709-150,+Brazil&ll=-23.583025,-46.83712&spn=0.037758,0.054932&z=14&iwloc=A&output=embed"></iframe><br /><small><a href="http://maps.google.ie/maps?f=q&source=embed&hl=en&geocode=&q=Avenida+S%C3%A3o+Camilo,+980,+Cotia+-+S%C3%A3o+Paulo,+Brazil&aq=0&oq=980,+avenida+sao+camilo&sll=-23.583184,-46.836844&sspn=92.879748,186.152344&t=m&ie=UTF8&hq=&hnear=Av.+S%C3%A3o+Camilo,+980+-+Cotia+-+S%C3%A3o+Paulo,+06709-150,+Brazil&ll=-23.583025,-46.83712&spn=0.037758,0.054932&z=14&iwloc=A" style="color:#D63B77;text-align:center;font-size:180%">Ver mapa ampliado</a></small>
</div><!-- end of content -->
<div class="strips logo"></div>
<div class="strips footer"></div>
</div><!-- end of container -->
</body>
</html>
如果有人可以帮助我,将不胜感激。
谢谢你。