Jump to content

Unwanted gaps underneath heading and paragraphs


NikMac

Recommended Posts

First off, thanks for all the help I've been getting here. You guys have really helped me get an understand for html/css (but there are still problems, argh!)

 

There's always a large gap between my paragraphs, and underneath my

tags. I've gone through the code many times and can't figure out what is causing this. My HTML is roughly:


[head, meta info, etc.]














[!!!Large unwanted gap here]


[and here]


[and here]

[sidebar, footer, navigation etc. here - all working normally. This makes me think it has something to do with "content" or "main" divs.]

Link to comment
Share on other sites

OK... this is a margins and padding issue.

 

p tags:

At the moment these tags have both top/bottom padding (7 px) and top/bottom margin (.6 em, or about 7 or 8 px).

 

h3 tags:

This element also has a top/bottom margin of .6 em (defined in "address, h1, h2, h3, h4, h5, h6, dd, dt, li, p, pre"). However, most of the issues are actually caused by the h2 tag, which has a line-height of 2, a -5px bottom margin, and a .6em top/bottom padding.

 

My suggestions:

Start with the h2 tag. Remove the line-height and negative bottom margin. Give it a padding 0, see how it looks, then adjust as necessary. Try giving the h3 and the p tags a padding-bottom of 0, and then adjust it as necessary.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...