Hi
I was looking at the source code of a site which had the code below in the
<head> section.
Could someone please explain whether this is a known and effective way of
compensating for browser CSS bugs, and if so, how it works?
Thanks,
Jeremy Clulow
<style type="text/css" media="screen">
<!-- /*<![CDATA[*/ @import url("standard.css"); /*]]>*/ --> </style>
<!--[if IE 5]> <style type="text/css" media="screen"> /*<![CDATA[*/
div.storybox { top: 100px;}
#header .logo { margin-top: 10px; }
.item { width: 48%; }
#menubox { width: 200px; }
#submenu li { margin: -1.1em 0em; }
#submenu { margin: 1em 0em 0em 0em; }
/*]]>*/ </style>
<![endif]-->
<!--[if IE 5.5000]> <style type="text/css" media="screen"> /*<![CDATA[*/
.logo { margin-top: 10px; }
.right { border-top: 10px; }
.item { width: 48%; }
#menubox { width: 200px; }
#submenu li { margin: 0.2em 0em; }
#submenu { margin: 1em 0em 0em 0em; }
/*]]>*/ </style>
<![endif]-->
--
~~~~~~~~~~~~~~~~~~~~~~~~~~
Jeremy Clulow,
Webs Wonder Design
www.webswonder.co.uk
jeremy@websNOSPAMwonder.co.uk
~~~~~~~~~~~~~~~~~~~~~~~~~~
Martin Honnen - 28 Dec 2003 17:55 GMT
> I was looking at the source code of a site which had the code below in the
> <head> section.
>
> Could someone please explain whether this is a known and effective way of
> compensating for browser CSS bugs, and if so, how it works?
A CDATA section is an XML construct, if you find it in a HTML page then
probably as someone tries to author XHTML. If you find it in the
complicated way you have posted then someone probably tries to author
XHTML that can be sent to HTML user agents with content type text/html.
As that is all tedious, cumbersome and error-prone it is usually best to
simply author HTML 4.01 and not XHTML 1.0, see
http://www.hixie.ch/advocacy/xhtml
for instance.
I don't think a CDATA section helps to hide CSS from certain browsers.

Signature
Martin Honnen
http://JavaScript.FAQTs.com/
Jeremy Clulow - 28 Dec 2003 22:02 GMT
|| I don't think a CDATA section helps to hide CSS from certain browsers.
Thanks for that. I won't bother trying to work out hwo it works then ;-)
Jeremy
--
~~~~~~~~~~~~~~~~~~~~~~~~~~
Jeremy Clulow,
Webs Wonder Design
www.webswonder.co.uk
jeremy@websNOSPAMwonder.co.uk
~~~~~~~~~~~~~~~~~~~~~~~~~~
Michael Bauser - 29 Dec 2003 06:14 GMT
> Hi
>
[quoted text clipped - 3 lines]
> Could someone please explain whether this is a known and effective
> way of compensating for browser CSS bugs, and if so, how it works?
Those are Internet Explorer "conditional comments". They're a
Microsoft-only hack:
http://msdn.microsoft.com/workshop/author/dhtml/overview/ccomment_ovw.
asp
Jeremy Clulow - 30 Dec 2003 02:02 GMT
|| Those are Internet Explorer "conditional comments". They're a
|| Microsoft-only hack:
||
|| http://msdn.microsoft.com/workshop/author/dhtml/overview/ccomment_ovw.
|| asp
Thanks for that. It looks interesting.
Jeremy
--
~~~~~~~~~~~~~~~~~~~~~~~~~~
Jeremy Clulow,
Webs Wonder Design
www.webswonder.co.uk
jeremy@websNOSPAMwonder.co.uk
~~~~~~~~~~~~~~~~~~~~~~~~~~