Web Design

(Nancy Kaufman) #1

154


Float Elements......................................................


2 In the style sheet, type #,
followed by the ID of the
element you want to float.
3 Press.
4 Type {.

1 In your editor, open a style
sheet document that is
linked to an HTML document.

Note: The following steps can
also be done using an existing
embedded style sheet.


Float Elements


P


erhaps the easiest method of creating multicolumn layouts involves using the CSS float
property. When you apply a float to an element, you are saying that the content that follows the
element in question can float next to it. In so doing, you can create columns in your content. The
three values of float are left, right, and none. Applying float:left allows the element to
float to the left of elements that follow it, and float:right allows the element to float to the
right. Setting float to none, the default, removes the float.

1


4


2

Free download pdf