CSS Layout How to - Push div below right floated content








Question

We would like to know how to push div below right floated content.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
#header, #quickSummary {<!-- ww  w  .j a v  a 2s .  c  o  m-->
  float: right;
  clear: right;
}

#preamble, #explanation {
  background-color: #AAA;
  border-top: 100px;
  clear: right;
}

#header, #quickSummary {
  width: 100px;
  height: 100px;
  background-color: #EEE;
}
</style>
</head>
<body>
  <div id="container">
    <div id="header">Header</div>
    <div id="quickSummary">Summary</div>
    <div id="preamble">Preamble</div>
    <div id="explanation">Content</div>
  </div>
</body>
</html>

The code above is rendered as follows: