Re: CSS: Use all classes of P _or_ Use H1,H2,H3,P, etc.??

by =?iso-8859-1?Q?St=E9phane?= Bergeron <stephberg(at)videotron.ca>

 Date:  Sat, 28 Apr 2001 12:26:47 -0400
 To:  hwg-techniques(at)hwg.org
 Cc:  Jay Smith <jay(at)JaySmith.com>
 In-Reply-To:  JaySmith
  todo: View Thread, Original
At 10:31 AM 28/04/01 -0400, you wrote:
>Hi,
>
>1) When developing a CSS, it it better to ...
>
>a) In your HTML define most "paragraphs", including headlines, etc.,
>etc. as classes of <.P>
>
>    OR
>
>b) To go ahead and use <.H1> and <.H2>, etc.
>
>    The reason that I ask is that I am not happy with the different
>amounts of space the different browsers use above and below each of
>these different elements.

If you care about Search engines indexing and keeping the logical structure=
=20
of your document intact then you better use heading tags for headings and=20
keep paragraph tags for paragraphs.  Otherwise things will be as messy as=20
when people used font tags to resize text and make it look header like=20
instead of using the proper tags.

>2) Also, for content inside tables, is it "better practice" to...
>    (I know I have to deal with NS's table/td inheritance problems.)
>
>    Both methods "work", but in some browsers, the <.P> method seems to
>end up with too much white space.
>
>a) use <.P> inside of <.TD> ?
>
>      <.TD>
>           <.P>content<./P>
>           <.P>content<./P>
>      <./TD>
>
>    OR
>
>b) Use <.BR> inside of <.TD> ?
>
>      <.TD>
>           content<.BR>
>           content
>      <./TD>

I personally use P tags inside of TDs because I care about the logical=20
structure of HTML documents but I'll often use br tags within a P tag to=20
avoid the default blank space a new P tag introduces.  400 years of=20
typography principles have taught us that a new paragraph should be marked=
=20
by indenting the first line, not by adding a blank line (pick up just about=
=20
any book from your library and you will notice this).  White space should=20
be used only to separate logical sections of text, not to mark a change of=
=20
paragraph.  The workaround I use is to use br tags within a large paragraph=
=20
to mark new paragraphs and insert 4 or 5 non breaking spaces to indent the=
=20
first line of the "new" paragraph.  I used that workaround specifically for=
=20
NN 4 who wouldn't remove space between paragraphs even when bottom and top=
=20
margins were set to 0 through CSS.  This workaround has the advantage of=20
working even in non-CSS browsers.  That method makes it mandatory to add=20
ample leading though so that's why using line-height on paragraph text is=20
so important.

HTH!

St=E9phane Bergeron

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA