DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Floating 2 Column Layout

05.15.2008
| 2692 views |
  • submit to reddit
        Basic CSS with global clear
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, 
p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, 
dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, 
sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, 
table, caption, tbody, tfoot, thead, tr, th, td {
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;
    font-weight: inherit;
    font-style: inherit;
    font-size: 100%;
    font-family: inherit;
    vertical-align: baseline;
    background: transparent;
}

:focus {
    outline: 0;
}

div#wrapper{
	width:800px;
	margin:0px auto;
}

div#header{

}

div#left{
	float:left;
	width:380px;
}

div#right{
	float:right;
	width:380px;
}

div#footer{

}

.clear{
	clear:both;
}	

HTML
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title></title>
<%= stylesheet_link_tag "application" %>
<link href="application.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div id="wrapper">
	<div id="header">
	
	</div>
	<div id="left">
	
	</div>
	<div id="right">
	
	</div>
	<div class="clear"></div>
	<div id="footer">
	
	</div>
</div>
</body>
</html>