添加时间:2008-07-30 原文发表:2008-07-30 人气:11 来源:http://www.blakems.com/experimental/hr/
默认HR标记是中间对齐,
下面是其他规则
Align Left
hr {width: 50%;
text-align: left;/*this will align it for IE*/
margin: 0 auto 0 0; /*this will align it left for Mozilla*/
}
Align Right
hr {width: 50%;
text-align: right;/*this will align it for IE*/
margin: 0 0 0 auto; /*this will align it right for Mozilla*/
}
Borders
Now lets add a 1px border on the top of the hr. For IE you need to give the hr a height of whatever the total height of the borders will be. So if you give thehra border of 1px on all sides the height will need to equal 2px.
hr {border: none 0;
border-top: 1px dashed #000;/*the border*/
width: 50%;
height: 1px;/*whatever the total width of the border-top and border-bottom equal*/
}
|
相关文章
相关评论