天馬行空

          There Can Be Miracles WHEN YOU BELIEVE

          統計

          最新評論

          SAFARI CSS HACK REDUX

          轉一個關于safari的css hack。
          文章來自http://themechanism.com/blog/2008/01/08/safari-css-hack-redux/
          In March 2007, I wrote about a Safari CSS hackcalled the "Pound Safari Post Semicolon" hack (coined by Tony at Simian Design). As of Safari 3.0, this hack no longer works. However, there is a way to target Safari 3.0 (and Opera as well):

          @media screen and (-webkit-min-device-pixel-ratio:0) {
          /* Safari 3.0 and Opera 9 rules here */
          }

          As always, the disclaimer(免責聲明): nobody condones the use of hacks, but we all (well, most of us) have to make use of them at least once in a while. The above code targets both Safari 3.0 and Opera 9. Hopefully, it will be a future-proof(未來保證) hack, since the -webkit part of the selector will probably not be adopted by other browsers.

          Example: The following code set the background color of the <body> element red in all browsers and then resets it to blue in Safari 3.0 and Opera 9.
          body { background-color: red; }
          @media screen and (-webkit-min-device-pixel-ratio:0) {
              body { background-color: blue; }
          }

          [demo]

          Tested on Mac OS X version 10.5.1 with Safari version 3.0.4 (5523.10.6) and Mozilla Firefox version 2.0.0.11. Tested on Windows XP Professional Version 2002 SP 2 with Mozilla Firefox version 2.0.0.11, Opera 9.10, and Microsoft Internet Explorer 6. Hack from CSS, JavaScript and XHTML Explained.

          posted on 2008-02-19 22:43 Fenris 閱讀(666) 評論(0)  編輯  收藏 所屬分類: 有關前臺

          主站蜘蛛池模板: 都兰县| 淮南市| 民权县| 寿阳县| 铜陵市| 通州市| 周至县| 昆山市| 蕲春县| 彰化县| 海阳市| 布拖县| 开原市| 邵武市| 象州县| 阿尔山市| 鹤壁市| 武威市| 宣武区| 乌鲁木齐县| 象州县| 临高县| 名山县| 乐陵市| 和林格尔县| 即墨市| 万荣县| 阿合奇县| 洛南县| 石渠县| 招远市| 乌拉特后旗| 和静县| 屏南县| 九龙县| 旬邑县| 曲阳县| 荣成市| 革吉县| 措勤县| 论坛|