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

Posted by Jukka K. Korpela on 09/03/07 16:20

Scripsit mbstevens:

> You don't get to invent tags like <my_section_head>.

Correct so far.

> You could use something like
> <span class="my_section_head">
> with css like
> .my_selection_head {...........

That would be foolish for several reasons. One of them is that when CSS is
off, <span> markup has no effect and its content is treated as text level
stuff with no special rendering. And the class name is not clever and
informative; just an example, yes, but a _bad_ example.

> Or, you could use something like
> <p id="my_section_head">
> with css like
> #my_section_head {.....

Wrong too. It's not a paragraph. It's a heading. You want it to appear as a
heading (whatever that means in each browser) even when CSS is not used.

And there's little reason to use an id attribute for styling when the
style_could_ well be something that you might use for other elements (other
headings) on the page as well.

The sensible approach is (assuming this is a 3rd level heading for
particularly sexy headings, among the different 3rd level headings on the
page)

<h3 class="sexy">...</h3>

with CSS like

h3.sexy { ... }

It's a good idea to add an id="..." attribute to the heading element, but
that's for linkability rather than styling. It _does_ allow a particular
element to be styled in a particular way, too, of course.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

 

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

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