473,569 Members | 2,716 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CDATA dealing with browser CSS bugs?

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.c ss"); /*]]>*/ --> </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****@websNOSP AMwonder.co.uk

~~~~~~~~~~~~~~~ ~~~~~~~~~~~
Jul 20 '05 #1
5 2088


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
On Sun, 28 Dec 2003 18:55:11 +0100, Martin Honnen <ma*******@yaho o.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****@websNOSP AMwonder.co.uk

~~~~~~~~~~~~~~~ ~~~~~~~~~~~
Jul 20 '05 #3
In article <3f************ ***********@new sread2.arcor-online.net>, one of infinite monkeys
at the keyboard of Martin Honnen <ma*******@yaho o.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
-----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 "conditiona l 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+/GKXKbhCU9m6R7EQ IItQCgmuWAtpF3F QT37F68exJGiMAw DZUAoNjY
w2P6KzMwctq/WFWBuGmoXNVy
=IBEd
-----END PGP SIGNATURE-----

Jul 20 '05 #5
On Mon, 29 Dec 2003 01:14:42 -0500, Michael Bauser <mi*****@bauser .com>
wrote:
|| Those are Internet Explorer "conditiona l 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****@websNOSP AMwonder.co.uk

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

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
17710
by: John van Terheijden | last post by:
Hi. I'm trying to develop a program that uses XML files store data. I'm using Windows XP, Apache 1.3.29 and PHP 4.3.4. Right now the XML file is read using the xml_parser_create(), xml_set_element_handler() etc. functions. I have difficulties with special characters in the data. I found information on "<!]>", UTF-8, XML DOM,
4
8584
by: alainpoint | last post by:
I am experimenting with ElementTree and i came accross some (apparently) weird behaviour. I would expect a piece of XML to be read, parsed and written back without corruption (except for the comments and PI which have purposely been left out). It isn't however the case when it comes to CDATA handling. I have the following code:...
2
7066
by: Dave Matthews | last post by:
Hi folks, I'm writing a web-page editing tool for my company which will allow staff (with no "technical" expertise) to maintain their own Intranet sites. The content for each webpage is stored in the form of XHTML in an XML document (which, in turn, is stored in an XML database). So far so good. However the editing tool must allow users to...
7
4109
by: Aziz | last post by:
Hi Folks I am trying to access an HTML code stored as CDATA section in the xml file listed bellow: <?xml version="1.0"?> <results count="5"> <!]> </results> The xml tree is the responseXML part of an XmlHttpRequest and is stored
10
2323
by: Simon Brooke | last post by:
Here's my problem: <xsl:template match="/category"> .... <script type="text/javascript"> &lt;!]&gt; </script> .... </xsl:template>
12
3969
by: Peter Michaux | last post by:
Hi, I am experimenting with some of the Ruby on Rails JavaScript generators and see something I haven't before. Maybe it is worthwhile? In the page below the script is enclosed in //<!]> Is this trick grounded in any real information about HTML vs XHTML? I
1
4575
by: Tarik Monem | last post by:
I have been able to successfully retrieve data from an xml file, where the data has been massaged a little bit, to create a table to be retrieved and it is displayed via a document.writeln within a javascript file, but now I am going to go completely AJAX & using innerHTML to display the same information to the browser. First, snippets of the...
7
5249
by: Silfheed | last post by:
Heyas So first off I know that CDATA is generally hated and just shouldn't be done, but I'm simply required to parse it and spit it back out. Parsing is pretty easy with lxml, but it's the spitting back out that's giving me issues. The fact that lxml strips all the CDATA stuff off isnt really a big issue either, so long as I can create...
9
3253
by: shapper | last post by:
Hello, Why do some pages I have seen have //<![CDATA[ in the beginning of a script tag before the script itself? Do I need this? Thanks, Miguel
0
7609
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7921
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6278
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2107
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
936
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.