开发者

How to explain CSS Float in general language?

How to explain CSS Float in general language (not Programming) ? Is there any real life example to take a example to ex开发者_开发问答plain CSS Float?

Is there any Slideshow in very simple way to explain float?


Explain it exactly like it sounds :)

It's called float because an element "floats" like a boat does. Consider the rest of the content water and the object a boat...the object displaces a certain amount of space and the water (other content) wraps around it. In the few times I've had to convey this property's meaning, this was the explanation that "got it across".

That doesn't cover the cross-browser quirks like IE floats, but for a general explanation, it works. For a complete explanation, I still think this is the best resource out there: simple tutorials on CSS floats.


The float property specifies how the element will be placed to the left or right of the parent container. After the float property is added to the element, it is moved either to the left or right side until it touches the edge of the container element or another floated element. The float property implies the use of block elements.

The property can have the next values:

  • left - the element floats to the left of its container element
  • right - the element floats to the right of its container element
  • none - the element does not float
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜