SitePoint Sponsor |
|
User Tag List
Results 1 to 7 of 7
Thread: Style in Head with XML error
-
Sep 30, 2006, 13:07 #1
- Join Date
- Jan 2004
- Location
- Temecula, CA
- Posts
- 188
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Style in Head with XML error
I'm getting a bizarre error from FF Firebug:
Code:missing } in XML expression margin-bottom: 110px;
Code:<comment> <style> #AlientameLinerNotesTop { margin-bottom: 110px; } </style> </comment>
Code:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
Code:<comment><style type="text/css" title=""> #BigOverview { margin-bottom: 0px; } </style></comment>
-
Sep 30, 2006, 13:17 #2
- Join Date
- Feb 2003
- Location
- Slave I
- Posts
- 23,424
- Mentioned
- 2 Post(s)
- Tagged
- 1 Thread(s)
Just so you know there is no such thing as a <comment> tag in (X)HTML, Maybe if you remove that you'll have better luck.
-
Sep 30, 2006, 13:27 #3
- Join Date
- Jan 2004
- Location
- Temecula, CA
- Posts
- 188
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Yeah, I know. It's an IE only thing, which is why it can be used to hide things from IE. FF sees the style which, by virtue of it being closer to the html, overrides the CSS file which is external. It's a hack, and I would rather avoid it, but I don't know of another way yet.
-
Sep 30, 2006, 14:43 #4
- Join Date
- Feb 2003
- Location
- Slave I
- Posts
- 23,424
- Mentioned
- 2 Post(s)
- Tagged
- 1 Thread(s)
Try using conditional comments instead. They only work in IE and won't bother any other browser.
-
Sep 30, 2006, 15:13 #5
- Join Date
- Jan 2004
- Location
- Temecula, CA
- Posts
- 188
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I tried this:
Code:<style type="text/css"> <!--[if gte IE 5] #AlientameLinerNotesTop { margin-left: 400px; font-family: Tahoma; } <![endif]--> </style>
When I put the same snippet of code in the body of the document it shows up in IE but not FF.Last edited by cweaver; Sep 30, 2006 at 15:52.
-
Sep 30, 2006, 16:16 #6
- Join Date
- Jan 2004
- Location
- Temecula, CA
- Posts
- 188
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
This didn't work before because I had inadvertently told my PHP to put the stuff within a script area. I was focussed on the style tags and didn't notice the script tags above and below them.
Code:<!--[if gte IE 5]> <style type="text/css" title=""> #AlientameLinerNotesTop { margin-left: 0px; } </style> <![endif]-->
While we're on the subject, if anyone would like to chime in with "It's better done this way..." I'm all ears.
Thanks.
-
Sep 30, 2006, 17:47 #7
- Join Date
- Dec 2004
- Location
- Sweden
- Posts
- 2,670
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
It's better to understand what's causing the bug and possible ways around it without any hacks.
Simon Pieters
Bookmarks