如下style是什么意思???

 1<style>   
 2<!--   
 3  
 4#slidemenubar, #slidemenubar2{ //#什么意思?   
 5position:absolute;   
 6left:-185px;   
 7width:160px;   
 8top:120px;   
 9border:1.5px solid green;   
10background-color:lightyellow;   
11layer-background-color:;   
12font:bold 12px Verdana;   
13line-height:20px;   
14}   
15\-->   
16</style>

---------------------------------------------------------------

是指定标签id值为#后面文字的标签的STYLE
---------------------------------------------------------------

1<span id="slidemenubar">asdf</span>

那么样式表中#slidemenubar,就是定义的这个特定id的元素的样式
---------------------------------------------------------------

是指定标签id值为#后面文字的标签的STYLE---这句更是不懂!!
id="slidemenubar"
它的style就是

 1<style>   
 2<!--   
 3  
 4#slidemenubar, #slidemenubar2{ //#&Ecirc;&sup2;&Atilde;&acute;&Ograve;&acirc;&Euml;&frac14;&pound;&iquest;   
 5position:absolute;   
 6left:-185px;   
 7width:160px;   
 8top:120px;   
 9border:1.5px solid green;   
10background-color:lightyellow;   
11layer-background-color:;   
12font:bold 12px Verdana;   
13line-height:20px;   
14}   
15\-->   
16  
17\---------------------------------------------------------------   
18  
19<head><style>   
20#d1{color:red}   
21#d2{color:blue}   
22#d3{color:green}   
23</style>
1<body>
2<span id="d1">111111111111</span>
3<span id="d2">222222222222</span>
4<span id="d3">333333333333</span>
5</body>

---------------------------------------------------------------

css代码的通式
selector {property:value;…}

selector分为三种,#slidemenubar叫做id selector,
意思就是在网页当中如果元素的id为slidemenubar,
则其包含的内容就使用#slidemenubar后面{}中设定的样式
---------------------------------------------------------------

这是CSS绑定的一种方式:

看例子效果!结合上下文!!

 1<html>
 2<head>
 3<title></title>
 4<meta content="EditPlus" name="Generator"/>
 5<meta content="JnKc" name="Author"/>
 6<meta content="" name="Keywords"/>
 7<style type="text/css">   
 8<!--   
 9td { font-size: 11pt; line-height: 1.3}   
10a:visited { color: #333333; text-decoration: none}   
11a:hover { color: #FF0000; text-decoration: underline overline}   
12#jnkc td { font-size: 15pt; line-height: 1.3; background-color: red}   
13#jnkc a:visited { color: #ffffff; text-decoration: none}   
14#jnkc a:hover { color: #0099ff; text-decoration: underline}   
15.jnkc2 td { font-size: 13pt; line-height: 1.3; background-color: green;color:white}   
16.jnkc2 a:visited { color: #ff9999; text-decoration: none}   
17.jnkc2 a:hover { color: #990099;}   
18\-->   
19</style>
20</head>
21<body>
22<table border="1">
23<tr>
24<td><a href="#">123456</a></td>
25<td>123456</td>
26</tr>
27</table>
28<div id="jnkc">
29<table border="1">
30<tr>
31<td><a href="#">123456</a></td>
32<td>123456</td>
33</tr>
34</table>
35</div>
36<div class="jnkc2">
37<table border="1">
38<tr>
39<td><a href="#">123456</a></td>
40<td>123456</td>
41</tr>
42</table>
43</div>
44</body>
45</html>
Published At
Categories with Web编程
Tagged with
comments powered by Disqus