我有一个div的链接。我用<br>
标签将它们排列在一起,因为我无法弄清楚如何在CSS中添加垂直间距。我尝试在样式规则中添加底部边距和底部填充,但似乎没有任何效果(为什么?)。我可以添加另一个<br>
标记来将它们分开,但我必须假设有一种更好的方法来处理CSS,这是我无法想象的。为什么底部填充和底部边距无助于在这些链接之间添加垂直间距?
<!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>Untitled Document</title>
<style type="text/css">
html, body
{
height: 100%;
margin: 0;
padding: 0;
font-weight:normal;
font-size:12pt;
font-family: Verdana, Arial, Helvetica, serif, sans-serif;
background:lime;
}
#linksouter
{
margin: 0;
padding: 0;
border-style:solid;
border-width:0px;
position:absolute;
top: 0px;
left: 0px;
width: 80px;
background: blue;
text-align:left;
}
#linksinner
{
margin: 80px 0 0 .5em;
width:100%;
background:fuchsia;
display:inline;
height:100%;
}
#linksinner a
{
color:red;
text-decoration: none;
background:yellow;
}
</style>
</head>
<body>
<div id="linksouter">
<div id="linksinner">
<a href="#">1</a><br />
<a href="#">1</a><br />
<a href="#">1</a><br />
<a href="#">1</a><br />
<a href="#">1</a><br />
</div>
</div>
</body>
</html>
我只是想说...... – jeroen 2009-07-16 00:19:52
然后我们同意:) – 2009-07-16 00:20:26