css学习1

来源:互联网 发布:python turtle 国旗 编辑:程序博客网 时间:2024/04/26 03:14

format:
selector {
 attribute1 : value;
 attribute2 : value;
 ...
 attribute3 : value;
}
Selector          HTML Code Affected
h1                Affects all<h1>tags in the document.
#heading          Affects the tag with an id attribute set to heading.
.blue             Affects all tags with a class attribute set to blue.
p#heading         Affects all<p> tags in the document with an id attribute set to heading.
p.blue            Affects all<p> tags in the document with a class attribute set to blue.
h1,h2,h3          Affects all<h1>,<h2>,and <h3> tags in the document.
p b               Affects all <b> tags that are contained inside <p>tags;<b> tags not inside<p>tags are not affected.
ul ul li          Affects all<li> tags that are inside at least two <ul>tags.
div.red           Affects all tags with a class attribute set to red that are also inside a div attribute.

CSS Attribute     Corresponding DOM Property
backgroud         backgroud
backgroud-color   backgroudColor
border            border
border-bottom     borderBottom
border-left       borderLeft
border-right      borderRight
border-top        borderTop
color             color
font              font
font-family       fontFamily
font-size         fontSize
font-weight       fontWeight
margin            margin
margin-bottom     marginBottom
margin-left       marginLeft
margin-right      marginRight
margin-top        marginTop
text-align        textAlign 

原创粉丝点击