CSS常见属性

2017-03-22  本文已影响0人  赵BW
容易忽略的点:
块状元素和行内元素
块状元素 行内元素
独占一行 可以与其他行内元素同行
可以设置宽高 不能设置宽高
可以当做容器 一般不用做容器
margin padding都有效果 margin padding只对左右有效
CSS 继承

(1)能继承的元素:letter-spacing、word-spacing、white-space、line-height、color、font、font-family、font-size、font-style、font-variant、font-weight、text-decoration、text-transform、direction、list-style、list-style-type、list-style-position、list-style-image、text-indent和text-align
(2)
不能继承:display、margin、border、padding、background、height、min-height、max-height、width、min-width、max-width、overflow、position、left、right、top、bottom、z-index、float、clear、table-layout、vertical-align、page-break-after、page-bread-before和unicode-bidi


让块级元、行内元素水平居中

单行文本溢出加 ....

p{
white-space:nowrap;//不换行
overflow: hidden;//多出的换行
text-overflow:ellipsis;//多出的文本是省略号
}


px, em, rem的区别
上一篇 下一篇

猜你喜欢

热点阅读