Css个人笔记(2)
1.对齐方式
div{
font-size:20px
border:1px solid black;
text-align:right;/*右对齐,同理可得 center 和left*/
height:200px;/*文本高度*/
line-height:20px;/*单行文本的间距*/
text-indent:2em;/*首行间距2格*/
}
当height==line-height(垂直居中的文本方法)单行文本居中!
1em = 1 * font-size;=20px; (文字的宽是一样的,2em就是两个文字的间距,并且随着设置的变化而变化)
<del>原价50元</del>
等效于
<span>原价50元</span>
span{
text-decoration:line-through;/*中划线*/
}
text-decoration:underline;下划线
text-decoration:overline;上划线