1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="UTF-8"> 5 <title></title> 6 <!--外链式--> 7 <!--link要写在head标签中--> 8 <link rel="stylesheet" type="text/css" href="01-accessory.css"/> 9 10 <!--嵌入式--> 11 <style type="text/css"> 12 #accssory1{ 13 200px; 14 height: 200px; 15 color: black; 16 background-color:greenyellow; 17 border: 10px solid gray; 18 text-align: center; 19 } 20 </style> 21 </head> 22 <body> 23 <div id="accessory"> 24 外链式 25 </div> 26 27 <div id="accssory1"> 28 嵌入式 29 </div> 30 31 <div style=" 200px;height: 200px;color: black; background-color: darkgreen;border: 10px solid gray; text-align: center;"> 32 内联式 33 </div> 34 35 <!--在CSS三种使用方式中,存在优先级问题,离元素越近优先级越高--> 36 </body> 37 </html>