CSS选择器

来源:互联网 发布:windows搭建ss教程 编辑:程序博客网 时间:2024/06/05 19:41
<!DOCTYPE html><html>  <head>    <title>选择器.html</title>    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">    <meta http-equiv="description" content="this is my page">    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><!-- 第一种选择器:  标签选择器<style type="text/css">p{   color: red;}</style><body><p>Hello world!</p></body>  --><!-- 第二种选择器:  id选择器  <style type="text/css"> #one{ color: yellow; } <body> <a id="one">Hello World!</a> </body> -->  <!--第三种选择器:class选择器   <style type="text/css">  .one{  color: green;  }  <body>   <p>床前明月光 </p>   <p class="one">Hello World! </p>   <a class="one">Hello world!</a><br>   <a>Hello World!</a>  </body>--><!-- 第四种选择器:伪类选择器  :选择标签的某个状态,需要配合其他选择器使用l  未访问过v  访问过h悬浮a激活<style type="text/css">a:link{color: pink;}a:visted{color: black;}a:active {color:green;}a:hover{color:blue;}<body>   <a href="www.baidu.com">Hello World!</a>  </body></style>--><!--  --><!-- 选择器综合使用 --><style type="text/css">#one,.two,font{color: green;}</style>  </head>  <body>   <a id="one" href="www.baidu.com">Hello World!</a>   <p class="two"> Hello World!</p>   <font>Hello World!</font>  </body></html>

原创粉丝点击