What is the function of zoom: 1 in CSS? What is the function of CSS zoom?
What is the role of zoom: 1 in CSS:
Suggestion: writing code as much as possible can effectively improve learning efficiency and depth.
The zoom attribute is used to set the object's zoom function and has browser compatibility issues. Firefox and operabrowser do not support this attribute. However, these are not the content described in this chapter. This chapter mainly introduces some special usage of this attribute. Let's take a look at a code example:
<! DOCTYPE html>
The code above causes the parent element to collapse because the child element is floating, that is, the parent element is not supported by the quilt element. Of course, you can use the clear floating to solve this problem. The code is modified as follows:
<! DOCTYPE html>
The above Code adds overflow: hidden to the parent element to clear the floating, and the parent element is opened. However, IE6 does not support using overflow to clear the floating, so you can use zoom: 1 to solve this problem, the code is modified as follows:
<! DOCTYPE html>
The preceding code is compatible with the IE 6 browser. The principle is that the haslayout attribute can be activated when zoom: 1 is applied to the element in IE6, that is, the attribute value is set to true, at this time, this element has a layout, so that it can be closed and floating, so that the parent element will not be unopened.
The original address is: http://www.softwhy.com/forum.php? Mod = viewthread & tid = 3371.
For more information, see: http://www.softwhy.com/shili/