in reply to Re: CSV or HTML?
in thread CSV or HTML?
Shame it wraps the CSS in that cargo cult <!-- --> nonsense. This was kinda useful for a few browsers in the mid-1990s, but is actively harmful today.
In XML DTDs (including the DTD for XHTML 1.1), there is no mechanism to specify that the content model for an element is CDATA. Thus the <!-- --> acts as a genuine XML comment, and causes the style sheet contained within it to be commented out and totally ignored.
If a browser is in HTML mode (i.e. you serve the page using Content-Type: text/html) you won't notice this, but as soon as you switch to Content-Type: application/xhtml+xml all your styles will disappear.
Illustration...
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>CSS demo</title> <style type="text/css"> p { color: green } </style> <style type="text/css"><!-- p.mine { color: red } --></style> </head> <body> <p class="mine">This should be green.</p> </body> </html>
The above, viewed in a standards compliant browser, in XHTML mode, will show a green paragraph. The CSS which sets it to red is commented out and ignored.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: CSV or HTML? (now OT)
by ww (Archbishop) on Jan 19, 2012 at 12:36 UTC | |
by Tux (Canon) on Jan 19, 2012 at 13:00 UTC | |
by ww (Archbishop) on Jan 19, 2012 at 13:28 UTC | |
by tobyink (Canon) on Jan 19, 2012 at 21:14 UTC | |
by ww (Archbishop) on Jan 20, 2012 at 01:22 UTC | |
by tobyink (Canon) on Jan 20, 2012 at 08:52 UTC | |
by Tux (Canon) on Jan 20, 2012 at 12:40 UTC | |
by MidLifeXis (Monsignor) on Jan 20, 2012 at 13:46 UTC | |
by ww (Archbishop) on Jan 20, 2012 at 14:13 UTC |