Jump to content
Stef's Coding Community
Sign in to follow this  
Andrea

#header h1 - margin top not cooperating

Recommended Posts

This is downright embarrassing, but I cannot figure out what's going on here:

 

http://tiny.cc/lw7DK

 

I am trying to move the h1 in the header down a bit - but every time I add a margin top to my #header h1 CSS, the ENTIRE header moves down - it's putting the margin to the #header, not just the #header h1. I know I'm a bit rusty, but this is ridiculous. I've checked everything and see nothing wrong.

 

#header h1 --- as far as I know, should ONLY affect the h1 inside my header div and NOTHING else. And strangely enough - adding margin-top to my #header h2 only affects the h2 inside the header and NOT the entire header...

 

and btw - this is a work in progress - I'm working on the formatting as we speak.

 

EDIT

I've added padding-top and that works - but I'd still like to know what's going on with the margin-top.

Edited by Andrea

Share this post


Link to post
Share on other sites

The #header div has a set height of 200px and giving the h1 too much margin-top will force the h1 margin above the overall height allowed for the #header div. The #header cannot contain all the stuff you have added, (img, h1, h2, etc), so it expands upwards.

Share this post


Link to post
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...
Sign in to follow this  

×
×
  • Create New...