CSS样式:属性
CSS有多种属性,根据继承性,主要可以分为2大类
(1)可继承属性
父标签的属性值会传递给子标签;
一般是文字控制属性;
如:
所有标签:visibility、cursor;
内联标签:line-height、color、font、font-family、font-size、font-weight、text-decoration;
块级标签:text-indent、text-aling;
列表标签:list-style
(2)不可继承属性
父标签的属性值不能传递给子标签;
一般是区块控制属性;
如:display、margin、border、padding、background;
height、min-heignt、mex-height、width、min-width、max-width;
overflow、position、left、right、top、bottom、z-index;
float、clear;
table-layout、vertical-align;
page-break-after、page-brean-before;
unicode-bidi;
div{
/*字体设置*/
color: orange;
font-size: 20px;
font-family: "Adobe Hebrew";
font-weight: bolder;
text-align: center;
/*边框设置*/
border-color: purple;
border-radius: 5px;
/*背景设置*/
background-color: green;
background: url("http://p3.pstatp.com/large/1940000367b378b1260d");
background-size: 50%;
/*display: none;*/ /*隐藏不可见,且不占位置*/
/*visibility: hidden;*/ /*隐藏不可见,仍占位置*/
cursor: pointer; /*改变属性显示*/
/*段落设置*/
text-indent: 30px;
text-decoration: none;
}
还没有评论,来说两句吧...