Clearing Floats : float layout : Layout Attributes HTML CSS TUTORIALS


HTML CSS TUTORIALS » Layout Attributes » float layout »

 

Clearing Floats


 



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
p,h1,h2 {
  margin-bottom: 1em;
}

#left {
  width: 200px;
  background: #aaa;
  height: 600px;
  border: 1px solid red;
  float: left;
  text-align: center;
}

#centre {
  margin-left: 220px;
  padding-right: 50px;
}

img {
  float: left;
  padding: 10px
}

h2 {
  clear: both;
  border: 1px solid red;
  line-height: 30px;
  background: #ccc;
}
</style>
</head>
<body>
<div id="left"
  <p>Left Floated Column</p>
</div>

<div id="centre"
  <h1>This is the header</h1>
  <h2>this is a test. this is a test. this is a test. </h2>
  <p>this is a test. this is a test. this is a test. this is a test. </p>
</div>
</body>

</html>

 



HTML code for linking to this page:

Follow Navioo On Twitter

HTML CSS TUTORIALS

 Navioo Layout Attributes
» float layout