css 3

Icon

A comprehensive CSS 3 reference guide, tutorial, and blog
Are you a CSS expert? Want to contribute? Contact us

CSS FLOAT

Floating elements are elements whose rendering boxes are shifted to the left or right side of the current line. Content boxes that follow are rendered along the side of the floated element; down the right side of elements floated to the left, and down the left side of elements floated to the right. This property controls this floating behavior, specifying an element float to the left, right, or not at all. For correct rendering, a floated element needs to have an intrinsic or assigned ‘width’ value.

 

Example

img.test { float: left }

<img src=”image.gif” mce_src=”image.gif” style=”float: left”>Some floating text.

 

Possible Values

Value Description
inherit Explicitly sets the value of this property to that of the parent.
none The element box is not floated.
left The current element box will be floated to the left. Subsequent content flows around it to the right, starting at the top of the element box If this value is given, the ‘display’ property for the current element is ignored, unless it has the value ‘none’.
right The current element box will be floated to the right. Subsequent content flows around it to the left, starting at the top of the element box If this value is given, the ‘display’ property for the current element is ignored, unless it has the value ‘none’.

 

3 Responses

  1. Mahesh says:

    Float is creating some problems. It will creating problem to background.So if you know the solicitation send me replay.
    example…

    .continer{background:green;width:800px;}

    $spotlight_title.data
    $spotlight_content. data$spotlight_content. data$spotlight_ content. data$spotlight_

    content.data$spotlight_ content.datadata$spotlight_content.data$spotlight_content.data

  2. Josh says:

    It’s one of the most-useful properties for layout, yet IE likes to mess it up, just as it likes to mess up the overflow property, auto width, the fieldset element has quirks if given a background, the box model is fussy, and even in IE8, there are various quirks that force compatibility mode such as overflow:scroll within a container that has float set to left or right. But, at least the box model is quite a bit more fixed in IE8.

Leave a Reply

Pages

Sponsors


CSS3.com



Please help CSS3.com stay alive and running

Bad Behavior has blocked 2361 access attempts in the last 7 days.