HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
Remove blank line after <H> and <P>
Post new topic   Reply to topic    HTML Help Forum Index -> CSS
View previous topic :: View next topic  
Author Message
litwits



Joined: 06 Feb 2008
Posts: 2

PostPosted: Wed Feb 06, 2008 8:58 am     Remove blank line after <H> and <P> Reply with quote

How do you remove the blank line following a header in CSS? In other words, how do you get a paragraph to follow immediately below the header without a black line in between? Likewise, how can one have paragraphs follow one another, as in a book, without a blank line in between each one?
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8428
Location: Castle Pines North, CO USA

PostPosted: Wed Feb 06, 2008 10:53 am     Reply with quote



Add margin to them
Code:
margin: 0px


_________________
Corey
Residential Office Solutions | Mile High Merchant Accounts | Expression Web Blog
litwits



Joined: 06 Feb 2008
Posts: 2

PostPosted: Wed Feb 06, 2008 11:49 am     Margin Reply with quote

That worked, thanks, but I'm not sure why. How does the orientation of the margin affect the vertical alignment of the text?
madprof



Joined: 26 Jan 2008
Posts: 98

PostPosted: Wed Feb 06, 2008 3:13 pm     Reply with quote

Browsers automatically apply top/bottom margin to these elements so they are spaced out by default.

I believe you need to watch the padding in Firefox as well, as this has slightly different behaviour to IE.
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8428
Location: Castle Pines North, CO USA

PostPosted: Wed Feb 06, 2008 3:20 pm     Reply with quote

Basically, extra space is there by default.

_________________
Corey
Residential Office Solutions | Mile High Merchant Accounts | Expression Web Blog
georgex5



Joined: 30 Jan 2008
Posts: 11

PostPosted: Sat Feb 09, 2008 8:03 am     Reply with quote

I had a similar problem with regular text--an extra line.

I found that adding <br> to the end of the text took care of it.
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> CSS All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial