两种实现标题右侧更多的例子:
HTML
<h2><a href="#" >标题</a> <a href="#">更多…</a></h2>
位置法
h2{
position:relative;
height:30px;
}
span{
position:absolute;
right:0;
top:0;
display:block;
height:30px;
}
浮动法
position:relative;
height:30px;
}
span{
position:absolute;
right:0;
top:0;
display:block;
height:30px;
}
h2{
height:30px;
}
span{
float:right;
display:block;
margin:-15px 0 0 0;
height:30px;
}
这里因为float会换行到h2标签的下面,利用margin-top 的负数将浮动层上移height:30px;
}
span{
float:right;
display:block;
margin:-15px 0 0 0;
height:30px;
}
原文网址:http://www.greencss.com/article.asp?id=100
原文网址:http://www.greencss.com/article.asp?id=100