Floating Elements to the Left or Right - HTML

The other way to position elements is to float them outside of the normal flow of elements. When elements are floated, they remove themselves from their normal position and float to the specified margin. The float property is used to float elements. This property has the following format:

float: right | left | none;

If the property is set to right, the element is floated to the right margin. If the property is set to left, the element is floated to the left margin. If the property is set to none, the element maintains its normal position as per the rest of its formatting properties. If the element is floated to a margin, the other elements will wrap around the opposite side of the element. For example, if an element is floated to the right margin, the other elements wrap on the left side of the element. For example, the image is not floated and appears in the normal flow of elements. The same image is floated to the right margin (via the style float: right).

A nonfloated image is rendered where its tag appears.

A nonfloated image is rendered where its tag appears.
An image that is floated is removed from the normal flow and is moved to the specified margin (in this case, the right margin), and the other elements wrap on the exposed side of the element.

An image that is floated is removed from the normal flow and is moved to the specified margin


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

HTML Topics