From: <Saved by Windows Internet Explorer 7>
Subject: Floatutorial: Float basics
Date: Mon, 16 Feb 2009 10:42:32 -0800
MIME-Version: 1.0
Content-Type: multipart/related;
	type="text/html";
	boundary="----=_NextPart_000_0000_01C99023.45B78540"
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350

This is a multi-part message in MIME format.

------=_NextPart_000_0000_01C99023.45B78540
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Location: http://css.maxdesign.com.au/floatutorial/introduction.htm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" =
"http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML lang=3Den><HEAD><TITLE>Floatutorial: Float basics</TITLE>
<META http-equiv=3Dcontent-type content=3D"text/html; =
charset=3Diso-8859-1">
<STYLE type=3Dtext/css media=3Dscreen>@import url( =
/stylesheets/floatutorial.css );
</STYLE>
<LINK href=3D"/floatutorial/floatutorial.ico" rel=3D"SHORTCUT =
ICON"><LINK=20
media=3Dprint href=3D"http://css.maxdesign.com.au/stylesheets/print.css" =

rel=3Dstylesheet>
<META content=3D"MSHTML 6.00.6000.16788" name=3DGENERATOR></HEAD>
<BODY>
<DIV id=3Dheader>
<H1>Floatutorial - Step by step CSS float tutorial </H1></DIV>
<UL id=3Dnav>
  <LI><A href=3D"http://css.maxdesign.com.au/index.htm">Home</A>=20
  <LI><A =
href=3D"http://css.maxdesign.com.au/listamatic/index.htm">Listamatic</A> =

  <LI><A=20
  =
href=3D"http://css.maxdesign.com.au/listamatic2/index.htm">Listamatic2</A=
>=20
  <LI><A=20
  =
href=3D"http://css.maxdesign.com.au/listutorial/index.htm">Listutorial</A=
>=20
  <LI><A=20
  =
href=3D"http://css.maxdesign.com.au/floatutorial/index.htm"><STRONG>Float=
utorial</STRONG></A>=20

  <LI><A=20
  =
href=3D"http://css.maxdesign.com.au/selectutorial/index.htm">Selectutoria=
l</A>=20
  </LI></UL>
<UL id=3Dnav2>
  <LI><A =
href=3D"http://css.maxdesign.com.au/floatutorial/definitions.htm">=AB =
Some=20
  definitions</A>=20
  <LI><A =
href=3D"http://css.maxdesign.com.au/floatutorial/index.htm">Main =
menu</A>=20

  <LI><A =
href=3D"http://css.maxdesign.com.au/floatutorial/clear.htm">Floats and=20
  "clear" =BB</A> </LI></UL>
<DIV id=3Dcontentblock>
<H2>Float basics </H2>
<H3>What is a float?</H3>
<P>When you float an element it becomes a block box. This box can then =
be=20
shifted to the left or right on the current line. The markup options are =
"float:=20
left", "float: right" or "float: none". </P>
<UL>
  <LI><A=20
  =
href=3D"http://css.maxdesign.com.au/floatutorial/introduction04.htm">Exam=
ple:=20
  "float: left" element</A>=20
  <LI><A=20
  =
href=3D"http://css.maxdesign.com.au/floatutorial/introduction05.htm">Exam=
ple:=20
  "float: right" element</A> </LI></UL>
<P>A floated box is laid out according to the normal flow, then taken =
out of the=20
flow and shifted to the left or right as far as possible. Content can =
flow down=20
the right side of a left-floated box and down the left side of a =
right-floated=20
box. </P>
<UL>
  <LI><A=20
  =
href=3D"http://css.maxdesign.com.au/floatutorial/introduction06.htm">Exam=
ple:=20
  "float: left" element with content flowing down right edge</A>=20
  <LI><A=20
  =
href=3D"http://css.maxdesign.com.au/floatutorial/introduction07.htm">Exam=
ple:=20
  "float: right" element with content flowing down left edge</A> =
</LI></UL>
<P>You can also put several floats beside each other. </P>
<UL>
  <LI><A=20
  =
href=3D"http://css.maxdesign.com.au/floatutorial/introduction08.htm">Exam=
ple:=20
  three elements without any float applied</A>=20
  <LI><A=20
  =
href=3D"http://css.maxdesign.com.au/floatutorial/introduction09.htm">Exam=
ple:=20
  three elements with "float: left" applied</A>=20
  <LI><A=20
  =
href=3D"http://css.maxdesign.com.au/floatutorial/introduction10.htm">Exam=
ple:=20
  three elements with "float: right" applied</A> </LI></UL>
<H3>Where will a floated element move to? </H3>
<P>Floated boxes will move to the left or right until their outer edge =
touches=20
the containing block edge or the outer edge of another float. </P>
<UL>
  <LI><A=20
  =
href=3D"http://css.maxdesign.com.au/floatutorial/introduction11.htm">Exam=
ple:"float:=20
  left" element against initial containing block</A>=20
  <LI><A=20
  =
href=3D"http://css.maxdesign.com.au/floatutorial/introduction12.htm">Exam=
ple:=20
  "float: right" element against initial containing block</A>=20
  <LI><A=20
  =
href=3D"http://css.maxdesign.com.au/floatutorial/introduction04a.htm">Exa=
mple:=20
  "float: left" element against containing block</A>=20
  <LI><A=20
  =
href=3D"http://css.maxdesign.com.au/floatutorial/introduction05a.htm">Exa=
mple:=20
  "float: right" element against containing block</A>=20
  <LI><A=20
  =
href=3D"http://css.maxdesign.com.au/floatutorial/introduction13.htm">Exam=
ple:=20
  "float: left" element against another floated box</A> </LI></UL>
<P>If there isn't enough horizontal room on the current line for the =
floated=20
box, it will move downward, line by line, until a line has room for it. =
</P>
<UL>
  <LI><A=20
  =
href=3D"http://css.maxdesign.com.au/floatutorial/introduction14.htm">Exam=
ple:=20
  "float: left" element shifted down</A> </LI></UL>
<H3>Do floated items need a width? </H3>
<P>You should always set a width on floated items (except if applied =
directly to=20
an image - which has implicit width). W3C's Cascading Style Sheets, =
level 2,=20
CSS2 Specifications states: </P>
<P><EM><A href=3D"http://www.w3.org/TR/CSS2/visuren.html#floats">"A =
floated box=20
must have an explicit width..."</A></EM> </P>
<P>If no width is set, the results can be unpredictable. Theoretically, =
a=20
floated element with an undefined width should shrink to the widest =
element=20
within it. This could be a word, a sentence or even a single character - =
and=20
results can vary from browser to browser. </P>
<UL>
  <LI><A=20
  =
href=3D"http://css.maxdesign.com.au/floatutorial/introduction15.htm">Exam=
ple:=20
  "float: left" with no width set</A> </LI></UL>
<H3>Elements above and below floated elements </H3>
<P>Block level elements above a floated element will not be affected by =
it.=20
However, elements below will wrap around the floated element: </P>
<UL>
  <LI><A=20
  =
href=3D"http://css.maxdesign.com.au/floatutorial/introduction16.htm">Exam=
ple:=20
  "float: left" element with block level element above</A>=20
  <LI><A=20
  =
href=3D"http://css.maxdesign.com.au/floatutorial/introduction17.htm">Exam=
ple:=20
  "float: left" element with element below</A> </LI></UL>
<H3>Borders, background images and background color </H3>
<P>While content will wrap around a floated element, border, background =
image=20
and background color will extend underneath. </P>
<UL>
  <LI><A=20
  =
href=3D"http://css.maxdesign.com.au/floatutorial/introduction18.htm">Exam=
ple:=20
  "float: left" element with bordered block level element below</A>=20
  <LI><A=20
  =
href=3D"http://css.maxdesign.com.au/floatutorial/introduction19.htm">Exam=
ple:=20
  "float: left" element with background-colored block level element =
below</A>=20
  </LI></UL>
<P>If you do not want elements below a floated element to wrap around =
it, you=20
can apply the clear property to the following element using "clear: =
left",=20
"clear: right" or "clear: both". </P>
<P><A href=3D"http://css.maxdesign.com.au/floatutorial/index.htm">Back =
to main=20
menu &#8594;</A> </P>
<ADDRESS>Other Max Design <A=20
href=3D"http://www.maxdesign.com.au/presentation/">articles and=20
presentations</A><BR>Associated with <A=20
href=3D"http://webstandardsgroup.org/">webstandardsgroup.org</A>=20
</ADDRESS></DIV></BODY></HTML>

------=_NextPart_000_0000_01C99023.45B78540
Content-Type: application/x-css
Content-Transfer-Encoding: quoted-printable
Content-Location: http://css.maxdesign.com.au/stylesheets/floatutorial.css

BODY {
	PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 90%; PADDING-BOTTOM: =
0px; MARGIN: 0px; COLOR: #000; PADDING-TOP: 0px; FONT-FAMILY: arial, =
helvetica, sans-serif; BACKGROUND-COLOR: #e6eeef
}
#header H1 {
	DISPLAY: none
}
H2 {
	FONT-SIZE: 160%; COLOR: #347879; BACKGROUND-COLOR: transparent
}
H3 {
	MARGIN-TOP: 20px; FONT-SIZE: 110%; COLOR: #347879; BACKGROUND-COLOR: =
transparent
}
.clearboth {
	CLEAR: both
}
#header {
	BACKGROUND-POSITION: 17px 0px; BACKGROUND-IMAGE: =
url(/floatutorial/images/header.gif); WIDTH: 100%; COLOR: #000; =
BACKGROUND-REPEAT: no-repeat; HEIGHT: 80px; BACKGROUND-COLOR: #fff
}
#contentblock {
	MARGIN-LEFT: 30px; WIDTH: 32em; PADDING-TOP: 10px
}
#contentblock2 {
	MARGIN-LEFT: 30px; WIDTH: 32em; PADDING-TOP: 10px
}
A:link {
	COLOR: #054345; BACKGROUND-COLOR: transparent
}
A:visited {
	COLOR: #888; BACKGROUND-COLOR: transparent
}
A:hover {
	COLOR: #600; BACKGROUND-COLOR: transparent
}
A:active {
	COLOR: #600; BACKGROUND-COLOR: transparent
}
HR {
	BORDER-TOP-WIDTH: 0px; CLEAR: both; MARGIN-TOP: 30px; =
BORDER-LEFT-WIDTH: 0px; BACKGROUND: #fff; BORDER-BOTTOM-WIDTH: 0px; =
COLOR: #fff; HEIGHT: 10px; BORDER-RIGHT-WIDTH: 0px
}
CODE {
	CLEAR: both; DISPLAY: block; COLOR: #333; FONT-FAMILY: courier, =
"courier new", monospace
}
#nav {
	PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 90%; PADDING-BOTTOM: =
2px; MARGIN: 0px; PADDING-TOP: 2px; BACKGROUND-COLOR: #347879
}
#nav LI {
	DISPLAY: inline; PADDING-LEFT: 30px; LIST-STYLE-TYPE: none
}
#nav A:link {
	COLOR: #fff; BACKGROUND-COLOR: transparent; TEXT-DECORATION: none
}
#nav A:visited {
	COLOR: #fff; BACKGROUND-COLOR: transparent; TEXT-DECORATION: none
}
#nav A:hover {
	COLOR: #347879; BACKGROUND-COLOR: #fff
}
#nav A:active {
	COLOR: #347879; BACKGROUND-COLOR: #fff
}
#nav2 {
	PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 90%; PADDING-BOTTOM: =
1px; MARGIN: 0px; PADDING-TOP: 1px; BACKGROUND-COLOR: #8db3b4
}
#nav2 LI {
	DISPLAY: inline; PADDING-LEFT: 30px; LIST-STYLE-TYPE: none
}
#nav2 A:link {
	COLOR: #043435; BACKGROUND-COLOR: transparent; TEXT-DECORATION: none
}
#nav2 A:visited {
	COLOR: #0f5557; BACKGROUND-COLOR: transparent; TEXT-DECORATION: none
}
#nav2 A:hover {
	COLOR: #fff; BACKGROUND-COLOR: #084c4e
}
#nav2 A:active {
	COLOR: #fff; BACKGROUND-COLOR: #084c4e
}
.mainmenu {
	PADDING-LEFT: 0px; MARGIN-LEFT: 0px; LIST-STYLE-TYPE: none
}
.mainmenu LI {
	PADDING-LEFT: 10px; FONT-SIZE: 95%; BACKGROUND: =
url(/listamatic/images/arrow.gif) no-repeat 0px 0.3em
}
TABLE {
	MARGIN: 0px 30px; COLOR: #333; BACKGROUND-COLOR: #fff
}
TH {
	COLOR: #000; BACKGROUND-COLOR: #bbb; TEXT-ALIGN: left
}
TBODY TH {
	FONT-WEIGHT: normal; BACKGROUND-COLOR: #fff
}
TBODY .row2 TH {
	BACKGROUND-COLOR: #ddd
}
.row2 {
	BACKGROUND-COLOR: #ddd
}
.foo {
	BACKGROUND-COLOR: #98bae0
}
CAPTION {
	FONT-WEIGHT: bold; FONT-SIZE: 110%; PADDING-BOTTOM: 5px; COLOR: #666; =
BACKGROUND-COLOR: transparent; TEXT-ALIGN: left
}
.submitlist LI {
	MARGIN-BOTTOM: 1em
}
.new {
	FONT-WEIGHT: bold; COLOR: #900; BACKGROUND-COLOR: transparent
}
.containingbox {
	BORDER-RIGHT: #666 1px solid; PADDING-RIGHT: 10px; BORDER-TOP: #666 1px =
solid; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; BORDER-LEFT: #666 1px =
solid; COLOR: #333; PADDING-TOP: 10px; BORDER-BOTTOM: #666 1px solid; =
BACKGROUND-COLOR: #fff
}
#content2 {
	FLOAT: left; MARGIN: 1em 0px 0px 20px; WIDTH: 500px
}
#sidebar2 {
	PADDING-RIGHT: 10px; PADDING-LEFT: 10px; BACKGROUND: #d6e0e1; FLOAT: =
left; PADDING-BOTTOM: 10px; MARGIN: 1em 0px 0px 20px; WIDTH: 200px; =
PADDING-TOP: 10px
}
#content2 H2 {
	MARGIN-LEFT: 0px
}
#content H3 {
	MARGIN-LEFT: 0px
}
#content P {
	MARGIN-LEFT: 0px
}
#content UL {
	MARGIN-LEFT: 0px
}
#content OL {
	MARGIN-LEFT: 0px
}
#content2 P {
	WIDTH: auto
}
#content OL {
	WIDTH: auto
}
#content2 UL {
	PADDING-LEFT: 0px
}
#content OL {
	PADDING-LEFT: 0px
}
#sidebar2 H2 {
	MARGIN: 0px
}
#sidebar2 H2 {
	MARGIN-LEFT: 0px
}
#sidebar H3 {
	MARGIN-LEFT: 0px
}
#sidebar P {
	MARGIN-LEFT: 0px
}
#sidebar UL {
	MARGIN-LEFT: 0px
}
#sidebar OL {
	MARGIN-LEFT: 0px
}
#sidebar2 P {
	WIDTH: auto
}
#sidebar OL {
	WIDTH: auto
}
#sidebar2 UL {
	PADDING-LEFT: 0px
}
#sidebar OL {
	PADDING-LEFT: 0px
}
#footer2 {
	CLEAR: both; BORDER-TOP: #666 1px solid; FONT-SIZE: 90%; MARGIN: 20px =
0px 20px 30px; WIDTH: 33em; PADDING-TOP: 5px; FONT-STYLE: normal
}
#footer2 P {
	MARGIN-LEFT: 0px
}

------=_NextPart_000_0000_01C99023.45B78540
Content-Type: application/x-css
Content-Transfer-Encoding: quoted-printable
Content-Location: http://css.maxdesign.com.au/stylesheets/print.css

BODY {
	PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: =
10pt; COLOR: #000; PADDING-TOP: 0px; FONT-FAMILY: arial, helvetica, =
sans-serif; BACKGROUND-COLOR: #fff
}
.clearboth {
	CLEAR: both
}
CODE {
	BORDER-RIGHT: #666 1px solid; PADDING-RIGHT: 10px; BORDER-TOP: #666 1px =
solid; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; =
BORDER-LEFT: #666 1px solid; COLOR: #000; PADDING-TOP: 10px; =
BORDER-BOTTOM: #666 1px solid; FONT-FAMILY: courier, "courier new", =
monospace; BACKGROUND-COLOR: #ddd
}
ADDRESS {
	BORDER-TOP: #000 1px solid; PADDING-TOP: 5px
}
#nav {
	DISPLAY: none
}
A:link {
	COLOR: #000; BACKGROUND-COLOR: transparent
}
A:visited {
	COLOR: #000; BACKGROUND-COLOR: transparent
}
A:hover {
	COLOR: #fff; BACKGROUND-COLOR: #000
}
A:active {
	COLOR: #fff; BACKGROUND-COLOR: #000
}
.new {
	FONT-WEIGHT: bold; COLOR: #900; BACKGROUND-COLOR: transparent
}

------=_NextPart_000_0000_01C99023.45B78540--
