You are here: Re: Problem with CSS file in IE7 « HTML « IT news, forums, messages
Re: Problem with CSS file in IE7

Posted by Norman Peelman on 09/03/07 22:27

John Hosking wrote:
> 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. ;-) )
>>

Not true, take a look at:
http://msdn.microsoft.com/msdnmag/issues/0500/cutting/

It can be done with alittle extra effort, Firefox and Opera just do a
better job of guessing what you (the average user) want.

>> 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.
>

Again Firefox and Opera are guessing what you want. IE expects a bit
more info.

> 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.
>
>

Norm

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация