[thelist] css class vs id (div or p )

Steve Cook steve.cook at evitbe.com
Fri May 10 03:57:01 CDT 2002

>From the HTML help files included with Homesite I read the following:

"The <DIV> element is a block element that is basically used as a
'container' to contain other HTML elements and display them discretely from
the rest of the document by adding paragraph breaks before and after the
contents of the <DIV> element.

<DIV> can contain any HTML between its opening and closing elements and
accepts the following attributes: "...

"The Paragraph element indicates a paragraph of text. No specification has
ever attempted to define exactly the indentation of paragraph blocks and
this may be a function of other elements, style sheets, etc.

Typically, paragraphs should be surrounded by a vertical space of between
one and one and a half lines.. With some HTML user agents, the first line in
a paragraph may be indented. "

I generally use a div element to mark out areas on the page, whether they
are positioned or not. I use P elements to contain text and images.

 Cookstour - http://cookstour.org

> -----Original Message-----
> From: Andrew Maynes [mailto:andrew at uk-webdeveloper.co.uk]
> Sent: den 10 maj 2002 10:49
> To: thelist at lists.evolt.org
> Subject: RE: [thelist] css class vs id (div or p )
> when and why would you use either <div> and <p> what are the
> differences?
> Andrew
> <p id="title">Main title - style used only once</p>
> <p class="subtitle">Subtitle - used continuously throughout
> the layout</p>
> > are there any pros or cons with using classes rather than
> > id's in css (eg
> > <div class="foo"> or <div id="foo"> ?
> >

More information about the thelist mailing list