All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
PHP编程常用技巧四则_php资料_编程技术
用javascript实现评估用户输入密码的强度_JavaScript技术_编程技术
探讨SQL,Server,2005.NET,CLR编程_mssql学习_编程技术
推荐:让你的MySQL数据库彻底与中文联姻_php资料_编程技术
ASP.NET,2.0中保证应用程序的安全_.net资料_编程技术
讲述PHP中Session的概念_php资料_编程技术
visual c++中设备环境类CDC
ASP.NET生成n位不同的验证码_[Asp.Net教程]
ASP.NET技巧:根据xsd生成xml文档_.net资料_编程技术
资深网管教你一步步安装MYSQL数据库_[PHP教程]
Reading number is top 10 pictures
Poor doll, hand job was caught the currently in effect by his dad
住院一星期,检测费两万
9.3阅兵全景图5-地空反舰导弹梯队
Summer is most suitable for young people to travel in China9
人造器官和铁肺人
沙漠里的美女
Sell the barbecue as says father du breul1
Abdominal hit by iron--HangZhou best driver parking save passengers
怀春少女-石一伊
The sixties of the last century, China is such a kill pig
Download software ranking
金山office2007
VeryCD电驴(EasyMule) V1.1.9 Build09081
Ashlynn Video2
传奇私服架设教程-chm
Boxer's Top ten classic battle3
Tram sex maniac 2 (H) rar bag7
Be there or be square
The king of fighters 97(Mobile phone games-apk)
WebService在.NET中的实战应用教学视频 → 第5集
WebService在.NET中的实战应用教学视频 → 第3集
归海一刀 published in(发表于) 2014/3/30 5:20:02 Edit(编辑)
为不同的浏览器载入不同CSS的二种方法_[Html教程]

为不同的浏览器载入不同CSS的二种方法_[Html教程]

为不同的浏览器载入不同CSS的二种方法_[Html教程]

  由于各浏览器(IE、gecko、opera......)对CSS的渲染方式都有所不同,造成显示效果不同,所以可通过对其载入不同CSS的方法来解决,下面介绍下二种方法来实现,不一定很实用,难的玩一把。

  纯CSS方式

  Code
  .box{
  width: 20em;
  height:20em;
  background: #369;
  }
  /*--gecko内核--*/
  @media all and (min-width: 0px){
  box{
  background: #CC0000;
  }
  }
  /*--opera hacks--*/
  /*--不能通过W3C CSS检验--*/
  

  以上代码运行的结果,在IE中是灰色,Opera中是紫红,Firefox中是蓝色

  在IE7以前版本还可采用CSS2的属性选择符来区别,不幸的是IE7开始已能识别。

  本文章由forestgan于15-Oct-2006发表

  javascript的方法

  var css_browser_selector = function() {
  var
  ua = navigator.userAgent.toLowerCase(),
  is = function(t){ return ua.indexOf(t) != -1; },
  h = document.getElementsByTagName('html')[0],
  b = (!(/opera|webtv/i.test(ua)) && /msie (\d)/.test(ua)) ? ((is('mac') ? 'ieMac ' : '') + 'ie ie' + RegExp.$1)
  : is('gecko/') ? 'gecko' : is('opera') ? 'opera' : is('konqueror') ? 'konqueror' : is('applewebkit/') ? 'webkit safari' : is('mozilla/') ? 'gecko' : '',
  os = (is('x11') || is('linux')) ? ' linux' : is('mac') ? ' mac' : is('win') ? ' win' : '';
  var c = b+os+' js';
  h.className += h.className?' '+c:c;
  }();

  此脚本能区别更多的浏览器,具体使用方法可看脚本原作者网站。




 
 
 
 
 


添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.