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