By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,788 Members | 1,115 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,788 IT Pros & Developers. It's quick & easy.

CDATA dealing with browser CSS bugs?

P: n/a
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
je****@websNOSPAMwonder.co.uk

~~~~~~~~~~~~~~~~~~~~~~~~~~
Jul 20 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a


Jeremy Clulow wrote:
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.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2

P: n/a
On Sun, 28 Dec 2003 18:55:11 +0100, Martin Honnen <ma*******@yahoo.de>
wrote:

|| 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
je****@websNOSPAMwonder.co.uk

~~~~~~~~~~~~~~~~~~~~~~~~~~
Jul 20 '05 #3

P: n/a
In article <3f***********************@newsread2.arcor-online.net>, one of infinite monkeys
at the keyboard of Martin Honnen <ma*******@yahoo.de> wrote:
A CDATA section is an XML construct,


That wasn't a CDATA section. It was a hack inside a comment.
It's commented out in all possible languages - HTML, XHTML and CSS.

So, we conclude that if it means anything at all, it's a hack to deal
with bugs in some browser. The remaining quoted material suggests
that the browser in question is probably MSIE. In any case, the
original question stands.

--
Nick Kew

In urgent need of paying work - see http://www.webthing.com/~nick/cv.html
Jul 20 '05 #4

P: n/a
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jeremy Clulow wrote:
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?


Those are Internet Explorer "conditional comments". They're a
Microsoft-only hack:

http://msdn.microsoft.com/workshop/a...w/ccomment_ovw.
asp

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 6.5.8 for non-commercial use <http://www.pgp.com>

iQA/AwUBP+/GKXKbhCU9m6R7EQIItQCgmuWAtpF3FQT37F68exJGiMAwDZUAo NjY
w2P6KzMwctq/WFWBuGmoXNVy
=IBEd
-----END PGP SIGNATURE-----

Jul 20 '05 #5

P: n/a
On Mon, 29 Dec 2003 01:14:42 -0500, Michael Bauser <mi*****@bauser.com>
wrote:
|| Those are Internet Explorer "conditional comments". They're a
|| Microsoft-only hack:
||
|| http://msdn.microsoft.com/workshop/a...w/ccomment_ovw.
|| asp

Thanks for that. It looks interesting.

Jeremy

--
~~~~~~~~~~~~~~~~~~~~~~~~~~
Jeremy Clulow,
Webs Wonder Design
www.webswonder.co.uk
je****@websNOSPAMwonder.co.uk

~~~~~~~~~~~~~~~~~~~~~~~~~~
Jul 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.