【发布时间】:2013-11-17 20:39:41
【问题描述】:
我正在学习 HTML,我正在尝试制作一个包含有用链接的标题。我用一个大 div 和 4 个 div 做了这个,但小 div 不在那个 div 里面,在这里看到它:My webpage
我的css代码是:
#header{
width:1200px;
height:25px;
background-color:#0A475C;
position:absolute;
left:50%;
margin-left:-600px;
-moz-border-radius: 15px 15px 15px 15px;
webkit-border-radius: 15px 15px 15px 15px;
border-radius: 15px 15px 15px 15px;
}
#login{
width:300px;
position:relative;
line-height:25px;
left:0px;
text-align:center;
}
#allroms{
width:400px;
line-height:25px
position:relative;
left:300px;
text-align:center;
}
#sobremi{
width:300px;
line-height:25px;
position:relative;
left:600px;
text-align:center;
}
#downloads{
width:300px;
position:relative;
line-height:25px;
left:900px;
text-align:center;
}
还有html:
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="css/pagina.css">
<title>Mi página</title>
</head>
<body>
<div id="header">
<div id="login"><a href="pagina/login.html">Log-in</a></div>
<div id="allroms"><a href="pagina/roms.html">Todas las ROMS</a></div>
<div id="sobremi"><a href="pagina/sobremi.html">Sobre mí</a></div>
<div id="downloads"><a href="pagina/downloads.html">Descargas</a></div>
</div>
</body>
</html>
刚刚解决了,不得不改变位置:相对;到位置:绝对;
【问题讨论】: