Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use clear in html5

Shulou Source: shulou.com Published: 2022-06-02 05:41:29 09月25日 Update

This article mainly explains "how to use clear in html5". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn how to use clear in html5.

In html5, clear means "clear" and is a style attribute that clears floating elements around elements. The syntax is "clear:value" or "Object.style.clear=value". By default, the attribute value is "none", indicating that floating elements are allowed to appear around elements.

The operating environment of this tutorial: windows10 system, HTML5 version, Dell G3 computer.

What is the meaning of clear in html5

In html, clear means to clear.

The clear attribute specifies which side of the element does not allow other floating elements.

The clear attribute defines which side of the element is not allowed to float. In CSS1 and CSS2, this is achieved by automatically increasing the top margin for clear elements (that is, elements with the clear attribute set). In CSS2.1, the cleanup space is added above the outer margin of the element, but the outer margin itself does not change. No matter which change, the end result is the same, and if declared to be cleared on the left or right, the upper outer border of the element is just below the lower outer margin of the floating element on that edge.

Examples are as follows:

Img {float:left; clear:both;}

Output result:

Thank you for your reading, the above is the content of "how to use clear in html5". After the study of this article, I believe you have a deeper understanding of how to use clear in html5, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Elements floats attributes meaning learning content situation results boundaries one side upper outer right that is ideas tutorials articles more styles environments computers Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi macOS MySQL OPPO Reno Huawei