Reputation: 927
Semantically it makes sense in the document to be written like this, I also imagine it better for SEO.
<div id="header"></div>
<div id="main"></div>
However, I want the 'main' section to be above the 'header' on screen.
Is there a way to do this using pure CSS?
Upvotes: 0
Views: 1549
Reputation: 78520
One way is with a container and some absolute positioning.
.container
{
position:relative;
}
#main
{
position:absolute;
bottom:100%;
}
<br><br>
<div class="container">
<div id="header">Hi I'm a header</div>
<div id="main">Hi I'm the content</div>
</div>
Upvotes: 2