加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

html+css排版同时使用两个选择器的方法

(2011-02-07 12:03:13)
标签:

it

分类: 网站制作

html+css排版同时使用两个选择器的方法

1.在html+css排版时,两个class选择器同时使用

<html>
  <head>
  <title>同时使用两个class</title>
  <style type="text/css">
  <!--
  .one{
      color:blue;        
  }
  .two{
      font-size:22px;    
  }
  -->
  </style>
     </head>

  <body>
      <h4>一种都不使用</h4>
      <h4 class="one">同时使用两种class,只使用第一种</h4>
      <h4 class="two">同时使用两种class,只使用第二种</h4>
      <h4 class="two one">同时使用两种class,同时使用</h4>
      <h4>一种都不使用</h4>
  </body>
  </html>

在html+css排版时,两个id选择器同时使用

<html>
  <head>
  <title>ID选择器</title>
  <style type="text/css">
  <!--
  #one{
      font-weight:bold;        
  }
  #two{
      font-size:30px;            
      color:#009900;            
  }
  -->
  </style>
     </head>

  <body>
      <p id="one">ID选择器1</p>
      <p id="two">ID选择器2</p>
      <p id="two">ID选择器3</p>
      <p id="one two">ID选择器3</p>
  </body>
  </html>  

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有