Sams Teach Yourself HTML, CSS & JavaScript Web Publishing in One Hour a Day

(singke) #1
ptg16476052

188 LESSON 8: Using CSS to Style a Site


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 us e the clear
property as well as the float property in the rule, as shown in this style sheet:

Input ▼
.right {
border: 3px solid black;
padding: 10px;
margin: 10px;
float: right;

FIGURE 8.17
Two right-floating
elements together.

FIGURE 8.18
A left-floating and
a right-floating ele-
ment together. 
Free download pdf