In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the float attributes of the div peer instance analysis of the relevant knowledge, the content is detailed and easy to understand, simple and fast operation, has a certain reference value, I believe that everyone after reading this float attribute div peer instance analysis article will have a harvest, let's take a look at it.
The NOTfloatC here does not want to continue to translate, but wants to move down. (in this case, the properties of floatA and floatB have also been set to float:left;.) this code has no problem in IE, and the title is FF. The reason is that NOTfloatC is not a float tag, so the float tag must be closed.
In between
< #div class="clear">This div does not necessarily have to maintain its position, and it must be at the same level as two div with float attributes, and there must be no nesting correlation between them, otherwise an ignition exception will occur. And the design and color of clear is defined as the following:
.clear {clear:both;}
② as the div of the external wrapper, do not fix the height. In order to make the height actively adapt, add overflow:hidden; to the wrapper when it includes float's box, and highly active adaptation is useful under the IE. This time should trigger the layout private attribute of IE (evil IE!) This can be done with zoom:1;, so compatibility is achieved. For example, a wrapper is defined as follows:
.colwrapper {overflow:hidden; zoom:1; margin:5px auto;}
③ for typesetting, the css drawing we use most is probably float:left. Sometimes we need to be a counterweight in the float div back of n-column, such as:
For example, we have to set the backup equipment of page to blue, so that the backing tone of all three columns is blue, but we will find that with the downward growth of left center right, the survival of page is highly stable. The reason is that page is not a float attribute, and our page cannot be set to float because it has to be centered, so how should we plan?
DIV delusions of embedding another float left with a width of 100%
④ all-around float closure (very important!) For the principle of clear float, please see [How To Clear Floats Without Structural Markup]. Add the following code to the Global CSS and add class= "clearfix" to the div that needs to be closed.
/ * Clear Fix * / .clearfix: after {content: "."; display:block; height:0; clear:both; visibility:hidden;} .clearfix {display:inline-block;} / * Hide from IE Mac * / .clearfix {display:block;} / * End hide from IE Mac * / / * end of clearfix * /
It can be configured as follows:
.hackbox {display:table; / / flashes an object as a table at the block element level}
Height non-adaptation is that the outer height can not be adjusted actively when the height of the inner object is changed, especially when the inner object uses margin or paddign.
This is the end of the article on "div sibling instance Analysis of float attributes". Thank you for reading! I believe you all have a certain understanding of the knowledge of "div peer instance analysis of float attributes". If you want to learn more knowledge, you are welcome to follow the industry information channel.
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.