MYOPERA/ASHUNG

Web Standard, XHTML, CSS, DOM and more...

Subscribe to RSS feed

CSS3 選擇器兼容性表

A few CSS3 selectors are already making their way into modern web browsers. Of the browsers tested thus far, Konqueror is the clear leader in implementation, with the Gecko (Mozilla, etc) engine not too far behind. In all cases I have used the latest current browser release, except for Internet Explorer where I’ve used the Beta of IE7 (as IE6 has no support at all).

Rather than go into depth about all the new selectors available in CSS3, you can read more about them in the W3C Selectors Working Draft and the excellent guide at 456 Berea St.

Note: The table below is not an exhaustive list of CSS3 selectors or modern browsers, it is only the beginning of a work in progress. As we continue to test, this table will expand. The tests have been run only on the most basic implementation of the selector, and should not be considered definitive.

Selector Gecko 1.81 IE 7 Opera 9 Safari 1.3 Safari 2.0 Konq. 3.5.4 OmniWeb 5.5 β1
E[foo*=”bar”] Yes Yes Yes Yes Yes Yes Yes
E[foo$=”bar”] Yes Yes Yes Yes Yes Yes Yes
E[foo^=”bar”] Yes Yes Yes Yes Yes Yes Yes
E ~ F Yes Yes Yes No Yes Yes Yes
:root Yes2 No No Yes Yes Yes Yes
:last-child Yes No No No3 No3 Yes No3
:nth-child() No No No No No Yes No
:nth-last-child() No No No No No Yes No
:only-child Yes No No No5 No5 Yes No5
:first-of-type No No No No No Yes No
:last-of-type No No No No No Yes No
:nth-of-type() No No No No No Yes No
:nth-last-of-type() No No No No No Yes No
:not() Yes No No Yes Yes Yes Yes
:empty Yes No No No3 Yes Yes Yes
:target Yes No No Yes Yes Yes Yes
:enabled Yes No Yes No No Yes No
:disabled Yes No Yes No No Yes No
:checked Yes2 No Yes No No Yes Yes
:selection Yes4 No No No Yes Yes Yes
  1. Gecko 1.8 is the rendering engine for Firefox, Mozilla Suite, Seamonkey, Camino, Flock, etc.
  2. For HTML documents, styling :root is the same as styling html.
  3. Support for styling checkboxes in Firefox is very limited.
  4. Safari and OmniWeb incorrectly apply this to all the selected elements.
  5. With browser prefix.
  6. Safari and OmniWeb incorrectly treat :only-child the same as :first-child.

Browser-Specific selectors (css hack)

,

IE 6 and below(6,5,4):
* html {}

*html {}

*html* {}

IE 7 and below(7,6,5,4):
*body {}

*body* {}

selector, {}

html* {/*未具體測試,有爭議*/}

IE 7 and 5:
*+html {}

IE 5 only:
*||* {}

*>html {}

>body {}

>html {}

IE 7 only:
*:first-child+html {}

*+html[xmlns] {}

IE 7 and Morden Browser only(ie7,Moz,FF,NN,Op,Sa,Kno...):
html>body {}

Morden Browser only on IE6(Moz,FF,NN,Op,Sa,Kno...):
html>/**/body {}

Opera 9 and below:
html:first-child {}

Safari:
html[xmlns*=""] body:last-child {}

Firefox and Gecko-based(FF,Moz,NN8+,SeaMonkey):
*|*:root {}

:root {}


:cool:轉載請寫明出處!
by Ashung http://my.opera.com/Ashung

60 best CSS directories you would die to watch!

,

Form: http://www.wittysparks.com/2007/04/22/60-best-css-directories-you-would-die-to-watch/
Site
Alexa Rank
Colors
Categories
Tags
Ratings
RSS
www.cssbeauty.com 10,432 No Yes Yes No Url
www.cssdrive.com 14,303 No Yes Yes Yes Thumbnail
www.stylegala.com 15,819 No No No Yes Thumbnail
www.cssmania.com 22,686 Yes Yes No Yes Thumbnail
www.cssremix.com 23,294 No No No Yes Full Image
www.alvit.de/css-showcase/ 26,557 No Yes No No Url
www.cssvault.com 27,285 No No No Yes Thumbnail
www.w3csites.com 28,078 No No No No Url
www.bestwebgallery.com 30,382 No Yes No No Thumbnail
www.csselite.com 33,948 No Yes No No Thumbnail
www.screenalicious.com 36,114 Yes No No Yes Thumbnail
www.unmatchedstyle.com 42,269 No Yes Yes Yes Full Image
www.designlinkdatabase.net 48,086 Yes Yes Yes Yes Thumbnail
www.screenfluent.com 51,014 No No No No Thumbnail
www.designsnack.com 51,904 No Yes No Yes Url
www.cssheaven.com 53,491 No Yes No Yes Thumbnail
www.cssimport.com 57,960 No No No Yes Thumbnail
www.cssglobe.com 65,660 No No No No Url
www.cssreboot.com 67,768 No No Yes Yes Url
www.mostinspired.com 68,025 No No No No Thumbnail
www.thebestdesigns.com 68,614 No Yes Yes No No
http://thesis.veracon.net 76,844 No No No No Thumbnail
www.cssbloom.com 79,672 Yes Yes Yes Yes Thumbnail
www.csscollection.com 92,579
www.csstux.com 98,129 No No No No No
www.cssbased.com 101,834 No Yes Yes Yes Url
www.css-website.com 102,923 Yes Yes Yes Yes Thumbnail
www.designshack.co.uk 109,656 No No No No Thumbnail
www.ceeses.com 124,001 No No No Yes Url
http://anjo.dekiteharu.jp 135,146 No Yes No No No
www.cssclip.com 135,730 Yes Yes Yes Yes Url
www.my3w.org 151,235 No Yes Yes Yes Thumbnail
www.csshazard.com 167,525 No Yes Yes No Full Image
www.artnetz.de 173,234 No Yes Yes No Thumbnail
www.css-design-yorkshire.com 177,077 No No No No No
www.css11.com 182,520 No No Yes Yes No
www.cssimpress.com 188,219 No Yes Yes Yes Thumbnail
www.e-motionaldesign.com 202,826 No Yes No Yes Thumbnail
www.cssprincess.com 210,811 No Yes Yes Yes No
www.cssgaleri.com 220,224 No Yes No No Thumbnail
www.cssblast.ru 224,048 No No No No Url
www.creative-pakistan.com 233,247 No Yes No Yes Thumbnail
www.netzfruehling.de 237,645 No No No No No
www.najdizajn.com 256,885 No Yes No Yes Thumbnail
www.edustyle.net 274,750 No No No Yes No
www.csssmoothoperator.com 290,827 No No No No Thumbnail
www.coolsitecollection.com 313,655 No Yes No No Thumbnail
www.cssgalaxy.com 348,352 No Yes No No Thumbnail
www.per.fectio.net 357,030 No No No Yes No
www.cssflavor.com 364,755 No No No No Thumbnail
www.onepixelarmy.com 369,312 No Yes No No Url
www.piepmatzel.de 418,803 No No No No Url
www.cssbrain.hu 438,074 No Yes No No Thumbnail
www.w3c-compliance.com 461,674 No No No No No
www.stylegrind.com 484,645 No No No No Url
www.submitcss.com 523,147
http://inspirace.dobrestranky.com 549,529 No Yes Yes Yes Full Image
www.cssgallery.ro 553,463 No Yes No Yes Url
www.cssgreen.com 600,815 No Yes No No No

countDIVs

,

这个简单函数可以用来计算文档div元素的总数。
function countDIVs () {
  var allDIVs = document.getElementsByTagName("div");
  alert(allDIVs.length);
}


可以输入到浏览器的地址栏或者存入书签。bigsmile
javascript:alert("This page has "+document.getElementsByTagName("div").length+" DIVs.");

IE7修正的bug

IE7修正的bug

更多信息可查看:
http://blogs.msdn.com/ie/archive/2005/07/29/445242.aspx

Install multiple versions of IE

More HTML* Hacks

很多人将
html* {}
当作IE 6/7 的CSS Hacks.
我发现html*在Konqueror上也一样被可以理解.当时用来测试的是Knoppix 4的Knoqueror 3.4和SuSE 10的Knoqueror.与Knoqueror同样基于KHTML的Saferi,可能会有类似的情况.
所以用html*定义只针对IE6/7的声明可能会让Knoqueror出现问题,应该和!important Hack一起用.
html* div {
           
           color: green;          /* for Knoqueror */
           *color: red; /* for IE 6 and 7 */
}

然而Knoqueror的用户实在太少了,可以不要考虑这个问题.

浏览器支持的CSS background-image图象格式

,

IE6: jpeg,gif,png8_index,bmp,wmf,ico,emf.
IE7: jpeg,gif,png8_index,bmp,wmf,ico,emf,png8_alpha,png16/32.
Firefox: jpeg,gif,png,bmp,ico,xbm,cur.
Mozilla: jpeg,gif,png,bmp,ico,xbm.
Netscape8: jpeg,gif,png,bmp,ico,xbm,cur.
Opera8/9: jpeg,gif,png,bmp,ico,xbm.
Konqueror3.4: jpeg,gif,png,ico,xbm,tif,tga,cur,xcf,xpm,rgb.

带索引通道的格式: gif,png8_index,wmf,emf,ico,xbm,cur(鼠标光标格式).
带Alpha通道的格式: png,ico,tga,xcf(GIMP的图象格式).
当ico文件包含多个尺寸128x128,48x48,32x32...,IE,Konqueror显示第一个格式, Mozilla/Firefox/Netscape/Opera显示最后的格式.
May 2012
S M T W T F S
April 2012June 2012
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31