The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Please help: Margin or Padding

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #31720

    I don’t understand the following: I have created a page container with a separate div header and also h1 in the header. I user universal selector to offset all paddings and margins.
    My intension was to make sure that h1 is not totally on the top of the header which has a set height, but a little bit below. So, I decided to insert:
    {margin-top: 10px;}

    However, instead of just shifting h1 10 pixel down in the header, my code shifted header 10px from the top of the browser.

    h1{padding-top: 10px } is what works for me. However, i do not understand why applying margin to h1 does not give me the same result. Who can tell me why? The link is below. thank you


    like wolf said…use top padding on the header and be done.


    thank you very much.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘CSS’ is closed to new topics and replies.