1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta charset="utf-8"> 5 <title>Document</title> 6 <style> 7 8 div{ 9 color: green; 10 font-size: 40px; 11 font-weight: bold; 12 } 13 14 15 .u211{ 16 color: red; 17 font-size: 50px; 18 } 19 20 #host{ 21 color: pink; 22 font-size: 70px; 23 } 24 25 26 .u985{ 27 color: blue; 28 font-size: 60px; 29 text-shadow: 5px 5px #ccc; 30 } 31 32 div,p{ 33 background: red; 34 } 35 36 body p{ 37 background: green; 38 } 39 40 div > p{ 41 background: yellow; 42 } 43 44 45 </style> 46 47 48 </head> 49 50 <body> 51 <div class="u211 u985">福州大学</div> 52 <div>福建师范大学</div> 53 <div class="u211">厦门大学</div> 54 <div>华侨大学 55 <p>this is a cup</p> 56 </div> 57 <div>集美大学</div> 58 <div class="u985">协和学院</div> 59 <span id="host">闽侯县上街镇街道办</span> 60 61 <p>this is a book!</p> 62 63 </body> 64 </html>
1.#id selector > .class selector(多个类选择器,在CSS文件中列在后面的优先) > tag selector(标签选择器)。
2.编写代码是犯了一个非常低级的错误。
while 写成了whlie.找了好久,真傻。继续努力。
浙公网安备 33010602011771号