日期:2014-05-17 浏览次数:20702 次
<!--下面是div标签,只需要对div标签的控制就可以改变div标签内的其他标签--> <div> <h1>TEST</h1> </div>
p{ font-size:12px; <!--设置p元素的字体大小--> font-family:"隶书"; <!--设置p元素的字体--> }
<style type = "text/css"> p{ color:#ff0000; font-size:24px; font-family:"隶书"; } </style>
<!--标签选择器--> h1{ color: red; } <!--类选择器--> <html> <head> <style type = "text/css"> .green{ color:#00f00; font-family:"宋体"; } </style> </head> <body> </body> </html> <!--id选择器--> <html> <head> <style type = "text/css"> #blue{ color:#0000ff; font-family:"宋体"; } </style> </head> <body> <p id = "blue">低头思故乡 </body> </html>
<html> <head> <style type = "text/css"> h1,#two,.red{ color:#ff0000; font-size:14px; } h2,h3{ color:#0000ff; font-size:16px; text-decoration:underline; <!--下划线--> } </style> </head> <body> <h1>静夜思</h1> <h2>床前明月光,</h2> <p class ="red">疑是地上霜.</p> <h3>举头望明月,</h3> <p id ="two">低头思故乡。</p> </body> </html>