CSS中關於注釋的三種方法介紹

來源:互聯網
上載者:User
通常CSS注釋代碼如果是單行注釋的話開始使用/*,結束使用*/,這裡向大家描述一下CSS代碼中進行注釋的三種方法,相信本文介紹一定會讓你有所收穫。

CSS代碼中進行注釋的三種方法

1、選取器(childselector)

如果你想在IE中隱藏一個CSS定義,可以使用子選取器。

CSS注釋代碼:

html>bodyp{  /*declarations*/  }

2、“萬用字元”(*)

這種寫法只有IE瀏覽器可以理解(對其他瀏覽器都隱藏)

CSS注釋代碼:

*htmlp{  /*declarations*/  }

3、“反斜線”(\)

如果你希望IE/Win有效而IE/Mac隱藏,可以使用“反斜線”技巧。

CSS注釋代碼:

/*\*/  *htmlp{  declarations  }  /**/
相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.