I’ve got about 400 pages to convert to XHTML and CSS ready to put into MODx.
I want to get the main article to the top of the html file, but don’t know enough about positioning to do it. Can anyone point me in the right direction?
An outline of the new page layout is...
<body>
<div id="main">
<div id="header">
<!-- full width 760 pix header; image is called in CSS -->
</div> <!-- end header div -->
<ul id="nav">
<!-- full width horizontal menu here -->
</ul>
<div id="container">
<div class="article_copy">
<!-- left column of main content -->
</div>
<div class="article">
<!-- main content is an article; the header is a h1 covered by a sIRF -->
</div>
<div class="on_visit">
<!-- right column here -->
</div>
</div> <!-- end container div -->
<div id="footer">
<!-- footer messages here -->
</div> <!-- end footer div -->
</div> <!-- end main div -->
</body>
I want to get the <div class="article"> to the top of the <div id="main"> section.
The relevant current CSS for positioning is...
#container {clear: both;}
.article_copy {
width: 85px;
float: left;
display: inline;
margin: 55px 0 0 20px;
font: 10px/11px Verdana, Arial, Helvetica, sans-serif;
}
.article {
width: 440px;
float: left;
display: inline;
margin: 0 10px 0 20px;
}
* html .article {width: 430px;}
.on_visit {
width: 178px;
float: left;
}
#footer {
width: 100%;
clear: both;
}
An outlined version of the page in Firefox 2 is attached.
Is this going to be hard to rearrange the divs?
Thanks,
posword
You could also set:
#header {
position: absolute;
top 0;
left 0;
}
#container {
position: relative;
top: (however tall the header is)
}
You may also want to wrap it all in #wrapper and set it’s position to relative. (If you want to center the content)