*:first-child+html CSS Hack
2009-03-15 20:41
525 查看
If the background color of this paragraph is green (a darker green than this page's background) then the hack was applied.
IE4-6/Win
Firefox
NS6.0-7.2
NS4.x
Opera 5+
Safari
Konqueror 3
iCab 3
IE5.x/Mac
Note: IE5.5/Win and IE6/Win will ignore any rule that use this selector hack, even if there are multiple selector chains, each separated by a comma, and one of the others would normally apply to an element in the document. This is a very serious parser bug. This is demonstrated in the second test below.
If the background color of this paragraph is green then the hack works. If this is yellow then the browser supports the "* html" (star html) hack, but ignores the second rule.
Example Code
p.test { background-color: #f66; } *:first-child+html p.test { background-color: #6f6; }
List of browsers that apply this
IE7, when in Standards Compatibility modeList of browsers that do not apply this
IE7, when in backwards compatibility mode (aka quirks mode)IE4-6/Win
Firefox
NS6.0-7.2
NS4.x
Opera 5+
Safari
Konqueror 3
iCab 3
IE5.x/Mac
Note: IE5.5/Win and IE6/Win will ignore any rule that use this selector hack, even if there are multiple selector chains, each separated by a comma, and one of the others would normally apply to an element in the document. This is a very serious parser bug. This is demonstrated in the second test below.
If the background color of this paragraph is green then the hack works. If this is yellow then the browser supports the "* html" (star html) hack, but ignores the second rule.
相关文章推荐
- Head First HTML & CSS chapter 1:认识HTML
- Head First HTML & CSS chapter 3 :构建模块
- 通过HTML注释实现方便的css hack
- $("INFO_ORGCODE").el.dom.parentNode.parentNode.firstChild.innerHTML = '人员代码';
- HTML-CSS hack
- Head First HTML & CSS
- 转 CSS hack:针对IE6,IE7,firefox显示不同效果 (转:http://www.cnblogs.com/wschacker/archive/2008/01/21/1047328.html)
- Head First HTML 与 CSS 学习笔记
- Head first HTML and CSS 总结-7. XHTML与CSS
- Image -- Head first into HTML
- HTTP Status 404 - /FirstFormServlet/MyHtml.html
- Head first HTML and CSS 总结-1.HTML简介
- Head First HTML 与CSS、XHTML 读书笔记
- Head first HTML&CSS ---[学习笔记第六章]
- Head First Html+CSS 笔记(三)
- 【阅读】《Head First HTML 与 CSS》第三章——构建模块
- 【阅读】《Head First HTML 与 CSS》第六章——标准与其他
- 《head_first_html_learnning》
- Head First HTML & CSS chapter 6 ,7 :HTML5标准,加一点CSS样式
- Head First HTML 与 CSS 笔记