区分浏览器类型的代码

September 12th, 2007 by Bruce Dou Views:118

<style type=”text/css”>
#example{color:red ;}/*firefox*/
* html #example{color:blue;}/*ie6*/
*+html #example{color:green;}/*ie7*/
</style>

<div id=”example”>在FireFox下应为红色,在IE6.0下应为蓝色,在IE7.0下应为绿色。</div>

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • 豆瓣
  • DZone
  • LinkedIn
  • MySpace
  • Reddit
  • RSS

Also see:

Tags: ,

Leave a Reply