Phorden
Phorden

Reputation: 1034

Header tag inside div pushes parent div down when applying margin or padding

I would like to move an H1 tag down that is inside of a container. If I put a margin or padding top on the H1 style or the div that it is in itself, it wants to push the parent div down with it. I don't know why this is. Thanks for any help on this matter.

CSS:

div.right-header{
  float:right;
  width: 45em;
}

div.title h1{
  font-family: 'AachenTL-Bold';
  font-weight:normal;
  font-style:normal;
  float:left;
  margin:0;
  padding:0;
  padding-left: 0.5em;
  color: #36F;
}

html:

<div class="title"><a href="/index"><h1>Gaa'Oziskwaajimekaag<br />Gabe Gikendaasoowigamig</h1></a></div>

URL to site: http://lltc.designangler.com/

Upvotes: 0

Views: 251

Answers (1)

codingrose
codingrose

Reputation: 15699

Give it absolute position.

Write:

div.title h1{
    position:absolute;
    font-family: 'AachenTL-Bold';
    font-weight:normal;
    font-style:normal;
    float:left;
    margin:0;
    padding:0;
    padding-left: 0.5em;
    color: #36F;
}

Upvotes: 1

Related Questions