Home  >  Article  >  Web Front-end  >  What is the function of zoom attribute in css

What is the function of zoom attribute in css

王林
王林forward
2020-03-18 10:44:074405browse

What is the function of zoom attribute in css

CSS zoom attribute

zoom: Set or retrieve the zoom ratio of the object, trigger the haslayout attribute of the IE browser, and solve some problems such as floating and margin overlap.

Syntax:

zoom:normal

(Recommended tutorial: CSS tutorial)

Parameters:

normal: Use the actual size of the object (default value)
number: Use numbers to define the zoom ratio, no negative numbers,

Example:

zoom:5

percentage: Use percentage to define the zoom ratio, no negative numbers can appear

Example:

zoom:200%

Zoom is a special attribute of IE browser. In the past, Firefox and Google etc. Some other browsers do not support it and have not passed W3C standards. But now this attribute is beginning to be standardized and has appeared in the draft of CSS3.

In addition:

Using the zoom attribute in css can enable the web page to realize the zoom function in IE7.

For example, if you want your web page to be reduced to half of its original size, then add style="zoom:0.5" to the body, such as:

Program code:

<body style="zoom:0.5">

Recommended related video tutorials: css video tutorial

The above is the detailed content of What is the function of zoom attribute in css. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:jb51.net. If there is any infringement, please contact admin@php.cn delete