Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

css
css float
float

What is float property in CSS?

Educative Answers Team

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

The CSS float property states how the element should float. For example, it can specify the position where the element should be placed.

Note: The element can be anything i.e., an image, a paragraph, a button, etc.

Syntax

The syntax for the float CSS property is:

float: value;

CSS float property can have the following values:

  • None: There will be no effect on the position of the element i.e., the element will not float.

  • Right: The element floats to the right of its container

  • Left: The element floats to the left of its container

  • Inherit: The element inherits the float value of its parent

Float: None

The following example displays the image when the float is set to none:

Float: Right

The following example makes the image float to the right of the container:

Float: Left

The following example makes the image float to the left of the container:

RELATED TAGS

css
css float
float
Copyright ©2022 Educative, Inc. All rights reserved

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring