1 <!doctype html> 2 <html> 3 <head> 4 <meta charset="UTF-8"> 5 <meta name="Generator" content="EditPlus®"> 6 <meta name="Author" content=""> 7 <meta name="Keywords" content=""> 8 <meta name="Description" content=""> 9 <title>Document</title> 10 <style> 11 p{ 12 width:200px; 13 height:20px; 14 background:gold; 15 } 16 div{ 17 width:300px; 18 height:30px; 19 background:skyblue; 20 } 21 </style> 22 <link rel="stylesheet" type="text/css" href="csss/cssss.css"/> 23 <!-- 24 link标签不可放到style中,标签不能放到标签中; 25 样式的三种写法: 26 1:style标签,头部样式; 27 2:link标签链接独立的css文件; 28 3:在标签中添加style属性; 29 优先级: 内联样式>外部样式(link和style看顺序) 30 --> 31 </head> 32 <body> 33 <p>你是猪</p> 34 <div style="100px;height:10px;background:pink">我是人</div> 35 <span>他也是猪,不过人家是小猪佩奇!</span> 36 </body> 37 </html>