Just to give you an example of what I mean, this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html
xmlns="http://www.w3.org/1999/xhtml"
lang="en"
xml:lang="en"
><head>
<meta
http-equiv="Content-Type"
content="text/html; charset=utf-8"
/>
<meta
http-equiv="Content-Language"
content="en"
/>
<link
type="text/css"
rel="stylesheet"
href="screen.css"
media="screen,projection,tv"
/>
<!--
Don't forget to implement these later!
<link
type="text/css"
rel="stylesheet"
href="print.css"
media="print"
/>
<link
type="text/css"
rel="stylesheet"
href="handheld.css"
media="handheld"
/>
-->
<title>
2 Column Layout - Percentage based
</title>
</head><body>
<div id="pageWrapper">
<h1>Site Name</h1>
<ul id="mainMenu">
<li><a href="#">Home</a></li>
<li><a href="#">Forums</a></li>
<li><a href="#">Links</a></li>
<li><a href="#">FAQ</a></li>
<li><a href="#">Contact</a></li>
</ul>
<div id="columnWrapper">
<div class="fauxColumn"></div>
<div id="content">
<h2>Test section heading</h2>
<p>
Content area test text
</p>
<!-- #content --></div>
<div id="sideBar">
<p>
SideBar test Content
</p>
<!-- #sideBar --></div>
<!-- #columnWrapper --></div>
<div id="footer">
Test Footer Content
<!-- #footer --></div>
<!-- #pageWrapper --></div>
</body></html>
with this SCREEN.CSS
/* null margins and padding to give good cross-browser baseline */
html,body,address,blockquote,div,
form,fieldset,caption,
h1,h2,h3,h4,h5,h6,
hr,ul,li,ol,ul,
table,tr,td,th,p,img {
margin:0;
padding:0;
}
img,fieldset {
border:none;
}
body {
text-align:center; /* center #pageWrapper IE 5.x */
font:normal 90%/140% arial,helvetica,sans-serif;
color:#333;
}
#pageWrapper {
min-width:752px;
max-width:1104px;
width:95%;
margin:0 auto;
text-align:left;
}
* html #pageWrapper {
/*
IE knows not the min-width, but we can fake it with an expression.
First, scripting off gets a crappy fixed width (oh well), then
the expression.
*/
width:752px;
width:expression(
(document.body.clientWidth>1152) ? "1104px"
: ((document.body.clientWidth>800) ? "auto" : "752px")
);
}
h1 {
padding:20px;
background:#ABC;
}
#mainMenu {
list-style:none;
background:#CDE;
}
#mainMenu li {
display:inline;
}
#mainMenu li a {
display:inline-block;
padding:4px 8px;
}
#columnWrapper {
position:relative;
overflow:hidden; /* wrap floats */
width:100%; /* trip haslayout, wrap floats IE */
background:#DDD;
}
.fauxColumn {
position:absolute;
bottom:0;
left:0;
width:75%;
height:999em;
background:#EEE;
}
#content,
#sideBar {
position:relative;
padding-top:1em;
}
#content {
float:left;
width:75%;
}
h2 {
padding:0 20px 0.25em;
}
p {
padding:0 20px 1em;
}
#sideBar {
overflow:hidden; /* prevent line indent after float */
height:1%; /* holly hack, trip haslayout, prevent float indent IE */
}
#footer {
padding:20px;
background:#ABC;
}
Is probably how I’d go about doing that… well, not true… I’d use a fixed side column width as variable width and narrow columns cause more problems than they solve (though I’d CONSIDER using EM there) which would open the door to using a faux-column images on #columnWrapper instead of the sandbag div.fauxcolumn I’m using. Works flawlessly all the way back to IE 5.5!
The real laugh being that’s the base HTML almost every website I’ve written the past six years is based on.
My advice to ANYONE interested in HTML5, particularly if you care about people actually USING your sites, is don’t even bother with that fat bloated wasteful idiocy. It only seems to exist to sell more books, prey on the ignorance of nubes and satiate the desires of the people who have the overwhelming need for “ooh, shiney and new!”… It certainly has NOTHING to do with making sites better, improving coding standards or rational decision making on the part of developers.
To be frank, ANYONE out there promoting it’s use should be ASHAMED OF THEMSELVES!
Sorry, didn’t mean to borderline threadjack – but it needs to be said… repeatedly, over and over again until people GET IT.