Forum Moderators: open

Message Too Old, No Replies

Eliminating <p> line breaks

         

collymellon

11:02 am on May 4, 2005 (gmt 0)

10+ Year Member



Hi all,

Is there anyway to eliminate the line break that the <P> element creates?

I want a <H2> header with some standard <P> text on the next line but the damm <P> puts a clearance line above and below....

Kind regards

Marketing Guy

11:09 am on May 4, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Can't you use <br> to drop the line after the <h2>? Same effect as standard <p> (ie, new paragraph), but no line spacing.

Example Header
Example text using <br>

Example Header

Example text using <p>

Robin_reala

11:27 am on May 4, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It's not a line break per se, it's margins. If (in your CSS) you set:

h1 { margin-bottom: 0; }
p { margin-top: 0; }

You'll see no space between them. I usually use a spacing of around 1em between my headings and paragraphs. Remember, margins collapse [w3.org].

collymellon

12:44 pm on May 4, 2005 (gmt 0)

10+ Year Member



great - worked a treat

thanks