1

At the top of my page I have a header (div) with just a few px distance to the top of the page. In the div I got my page title and Its placing itself in the top left corner (wich is normal). But it down at the bottom of the div (still at the right). This is my html:

<body>
    <div id="header">
        <h1>x</h1>
    </div>
</body>

And my CSS:

#header {
    width: 700px;
    height: 200px;
    margin-left: auto;
    margin-right: auto;
    background-color: #ffffff;
    color: #cdffaf;
    font-size: 30px;
}

h1 {
margin-top: 5px;    
}
10
  • Can you explain "But it down at the bottom of the div". What do you want (or see) at the bottom of the div? Commented Apr 18, 2013 at 19:07
  • Could you maybe clarify what you're asking? Commented Apr 18, 2013 at 19:07
  • Where do you want the text to be? You're question isn't clear.
    – DAC84
    Commented Apr 18, 2013 at 19:07
  • use developer tools to check the elements. maybe they're inheriting css.
    – Kai Qing
    Commented Apr 18, 2013 at 19:07
  • 1
    Like this?
    – Vucko
    Commented Apr 18, 2013 at 19:09

1 Answer 1

1

You can use display: table-cell with vertical-align: bottom;

Demo

Color Changed (For Visibility)

Not the answer you're looking for? Browse other questions tagged or ask your own question.