|
Posted by John Hosking on 09/03/07 16:04
Mike wrote:
> Hi,
>
> I have some html that relies on a stylesheet and although the styles
> are recognised in FireFox 2, in IE7 the page displays without any
> colour or font styles being applied.
>
> My stylesheet.css contains several sections like the following :
>
> my_section_head {
[declarations omitted]
> }
>
> These are referred to in the page.html file in a similar way to this :
>
> <div id="Chroma_Sub_Sample">
> <my_section_head>Chroma Sub Sample</my_section_head
Oops, there's your problem: it doesn't work that way. You can't just
invent a new element the way you have here. You've tried to invent the
my_section_head element, which HTML doesn't (and won't) include or
recognize. (Even ignoring the missing > on the closing tag. ;-) )
>
> I don't believe the problem is down to IE not being able to see the
> stylesheet because if I change eg "rsm_head" to "h3" as follows in the
> stylesheet and html file then the formatting is picked up :
Right, because HTML knows about h3; it's in the DTD. Maybe Jukka or
someone will come along and expound on DTDs and their extensibility, but
you should simply move to standard HTML.
>
> Is there something wrong with the names I've picked ? I mean, must
> they be specified in a certain way or start with a special
> character ? I tried prefixing my_section_head with "." and with "#"
> but that made no difference.
Try a CSS tutorial and pay attention to how elements and their rules are
used/referredd to. http://css.maxdesign.com.au/selectutorial/ is one I
like.
--
John
Pondering the value of the UIP: http://improve-usenet.org/
[Back to original message]
|