Subject:
|
Re: Which HTML to use?
|
Newsgroups:
|
lugnet.publish.html
|
Date:
|
Mon, 5 May 2003 20:55:23 GMT
|
Viewed:
|
3395 times
|
| |
| |
In lugnet.publish.html, William R. Ward writes:
> "Constantine Hannaher" <channaher@netscape.net> writes:
> > Now I know you are writing quickly and upon reflection will recognize that
> > putting a class on a font tag is just a bizarre idea. :-) Although <div
> > id="postheaders"><h1>foo</h1></div> where an external stylesheet has a
> > declaration .postheaders h1 {font-size: 0.8ex;} might look a little long, it
> > puts the burden of figuring out how to display on the rendering engine of
> > the user agent. I should probably have set the follow-up to publish.html...
>
> OK I moved this part of the thread there...
>
> Why not just use <h1 class="postheaders">foo</h1> instead? I'm not a
> CSS expert but that's how I would have done it...
>
> --Bill.
Because that way every instance of a first-level heading that needed the
desired effect would have to include the class attribute. When hand-coding,
especially, it's a waste, and the coder has to remember how to achieve the
effect. By establishing a division as a special area of the document,
contextual selection ensures that every <h1> in that division gets the
applied formatting. Other rules might set forth how to treat the entire
series of heading levels, or how to display dictionary lists (which I think
might work well for the "label : value" arrangement at the top of a
displayed post). None of those tags would have to be marked up to indicate
that they are treated differently, their mere presence inside the <div> of
that particular id attribute makes the difference. An <h1> inside a <div
id="pageheader"> would NOT get that particular style rule applied. Oops, and
that rule declaration should be #postheaders, sharp for id, dot for class.
Sorry. Someone coming along later adding a heading at that location needn't
even know that there is a style rule but it would get applied anyway.
Contextual selection, adjacent elements selection, first-child selection,
there is a whole array of tools to apply style rules to a particular element
while avoiding the placement of a class for a particular element.
Constantine
|
|
Message is in Reply To:
| | Re: Which HTML to use?
|
| (...) OK I moved this part of the thread there... Why not just use <h1 class="postheaders">foo</h1> instead? I'm not a CSS expert but that's how I would have done it... --Bill. (22 years ago, 5-May-03, to lugnet.publish.html)
|
7 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|