In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces the relevant knowledge of "how to use clear in css". The editor shows you the operation process through an actual case. The operation method is simple and fast, and it is practical. I hope this article "how to use clear in css" can help you solve the problem.
In css, the clear attribute is used to clear the floating effect of the element, which specifies the effect of the floating element on the left or right side of the paragraph; the default value of this attribute is none, which means that floating elements are allowed to appear on both sides, or you can set that there can be no floating elements on the left, right, or left and right sides of the element, and the syntax is "element {clear: attribute value;}".
The operating environment of this tutorial: windows10 system, CSS3&&HTML5 version, Dell G3 computer.
What is the use of clear in css
The role of clear in css is to clear the floating effect of an element.
The clear attribute specifies elements that are not allowed to float on the left or right side of the paragraph.
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.
Clear attribute value:
Eft does not allow floating elements on the left.
Right does not allow floating elements on the right.
Both does not allow floating elements on the left and right sides.
None default value. Allow floating elements to appear on both sides.
Inherit states that the value of the clear attribute should be inherited from the parent element.
Examples are as follows:
123 img {float:left;} p.clear {clear:both;}
This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.
This is also some text. This is also some text. This is also some text. This is also some text. This is also some text. This is also some text.
Output result:
This is the end of the content about "how to use clear in css". Thank you for reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.