|
Posted by jojo on 07/29/06 14:42
> "Harlan Messinger" <hmessinger.removethis@comcast.net> skrev i meddelandet
> news:4j0ujgF5ioshU2@individual.net...
>> Luigi Donatello Asero wrote:
>>> "David Dorward" <dorward@yahoo.com> skrev i meddelandet
>>> news:eae8g9$6cv$1$8302bc10@news.demon.co.uk...
>>>> Luigi Donatello Asero wrote:
>>>>
>>>>>> Headings are block level elements and may be child elements of the
>>> body.
>>>>> Yes, but why do you not have a look at these examples?
>>>>> http://www.w3.org/TR/html401/struct/global.html#h-7.5.5
>>>> Yes? You can mark up sections of a document using div elements. It can
> be
>>>> useful to do so under some circumstances. It isn't required, and there
> is
>>>> no mention of "SHOULD" there.
>>>>
>>>>>> The traditional method of identifying where one paragraph ends and
>>>>>> another begins on the WWW is through margins.
>>>>> Every <div> should have an "id" or at least a "class".
>>>> No. Only add markup if it is going to be useful. Giving an element an
> id
>>> or
>>>> class just because you are adding an element is wasteful.
>>> So, do you mean that W3 does not recommend to use a <div> for each
> heading ?
>> Do *you* see where it recommends that?
>
> Unfortunately, I have a vague memory of that. I may be wrong on that
> subject.
> But, on the other hand they just showed an example where they used different
> <div>s for each passage.
> The word paragraph which I used before was wrong. Sorry.
>
>>> Headings are useful because they give an overview for the readers
>>> and can be read by text browsers and robots as well
>> Right, and headings are marked with <h1>, <h2>, etc. No divs are involved.
>
> No matter whether they are involved or not, if you have a very long text on
> one page as I have (which also has some advantages)
> the use of <div>s helps me to use the right headings because it let me
> understand whether a part of the page is a subsection or a subsubsection and
> so on. But once I have used the different <div>s how could I style them?
You don't have to! One possibility would be to style all sections the
same, all subsections same (but different from the sections), all
subsubsections same again (but again different from the sections and
subsections). You could do it like this:
div p {font-size:20px;}
div div p {font-size .8em}
div div div p {font-size .9em}
just an example. I would not change the color or font-family, just the
size or font-style (you could make the subsubsections italic for
example).Another possibility (which I would prefer) would be to set
different paddings on each sub-group:
div {padding-left: 1em;}
should look like this:
|''''''''''''''''''''''|
| section |
| |'''''''''''''''''''|
| | subsection |
| | |''''''''''''''''|
| | | subsubsection |
| | |________________|
| | |''''''''''''''''|
| | | subsubsection |
| | |________________|
| |___________________|
| |'''''''''''''''''''|
| | subsection |
.. . .
.. . .
.. . .
HTH, jojo
Navigation:
[Reply to this message]
|