HTML and CSS Reference
In-Depth Information
A left-floating and
a right-floating ele-
ment together.
As you can see, when you put two floating elements together, they appear next to each
other. If you want the second one to appear below the first, you need to use the clear
property as well as the float property in the rule, as shown in this style sheet:
.right {
border: 3px solid black;
padding: 10px;
margin: 10px;
float: right;
width: 33%; }
#second { clear: right; }
.bottom { clear: both; }
The additional <div> I've added has been given the ID second, so that it inherits all the
styles of the class right and also the style rule associated with the ID second . The result
is in Figure 8.16.
Search WWH ::

Custom Search