Previous Message
Next Message

p, h1 etc

Sent by Michael Landis on 2 December 2003 18:06


David wrote:

> could someone give me a quick lowdown on how to use (or why to use)
> CSS with the HTML tags paragrapgh, h1, h2 etc

Hi, David,

It really depends on what you want to do with them. Many CSS-presented
sites use the individual tags in relationship to their context -- for
example, a list inside of the content area of a page may need to look like
a list, while a list in the navigation area may look like a drop-down menu.

Unless a tag is only used in one specific circumstance -- for example, if
H1 is only ever used for the page title -- then the tag is typically
associated with another selector, such as

#content p {
  normal formatting for a paragraph
}

#sidebar p {
  a paragraph formatted as a blurb in a sidebar (perhaps smaller text?)
}

This lets you have relatively clean HTML:

<div id="content">
  <p>This is a paragraph.</p>
</div>
<div id="sidebar">
  <p>This is a blurb.</p>
</div>

The alternative to something like this is to apply specific classes to each
paragraph, but this can get messy, since every paragraph would have to have
a class applied to it.

For more on this subject, take a look at the Wiki page
http://css-discuss.incutio.com/?page=ClassesVsIds and the references at the
bottom of that page.

HTH,

MikeL

______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread:

Possibly related: