作者  fcamel (飛啊!起舞的小駱駝)  看板   P_fcamel
 標題  [web]   CSS: hack IE/Mozilla
 時間  Mon Aug 23 20:05:10 2004


http://www.xxc.idv.tw/mt/archives/xxc/001183.html

因為CSS有許多好語法IE6不支援, 像是position:fixed,
不支援意謂著, 若你使用它的話, 使用IE的人, 會看到奇妙的景象

上網查查後, 沒想到大一卡車的人都在hack這方面的事,
找出兩者不同時支援的語法, 使用它

花了一些時間看了看, 感覺child selector(*1)最好用,
現在我的網站, 用mozilla看, 左邊的index是固定的,
用IE看沒有, 但至少能正常顯示 :)

另外IE對PNG的支援很糟, 愈來愈多用途表示,
該廢棄IE轉投向Mozilla的懷抱了

PS

*1 about child selector
http://webdesign.about.com/cs/css/qt/tipcsschild.htm

Precise Definitions of CSS Styles

In CSS a parent element is an element that contains other elements. All
elements that are contained within that parent are called "child" elements.
Using the CSS child selector, you can define properties that only affect
elements that are children of other specific elements. Every element is
a child of another element except the root element, which has no parent.

To select all paragraphs that are children of the <body> tag, you would
write:
  body > p { background-color : #00f; }

This is similar to the decendent selector but can only define children,
not grandchildren or lower.

You can combine the child selector with other selectors, such as decendants:
  div ul>li p { background-color : #00f; }
This affects a p element that is a decendent of li which is a child of ul
which is a decendant of div.
Browser Support

Internet Explorer 6 and lower (Windows) and 4.5 and lower (Macintosh) don't
support this selector. Netscape 4 and lower don't support this selector.