如何在 html 中缩放图像的一部分?
How to zoom part of an image in html?
我想在 html 中放大图像的一部分。
为了在 html 中只显示部分图像,我在第一条评论中写了一段代码。
我想放大显示的 part.How 可以吗?
<!DOCTYOE html>
<html>
<head>
<style>
.container {
position: relative;
}
#clip {
position: absolute;
clip: rect(0, 120, 80px, 0);
/* clip: shape(top, right, bottom, left); NB 'rect' is the only available option */
}
</div>
</style>
</head>
<div class="container"> <img src="images10.png" /> </div>
<div class="container"> <img id="clip" src="images10.png" /> </body>
</html>
您可以试试下面的代码,它会缩放指定的部分:
#clip { zoom: 150%; }
仅供参考:More info here
我想在 html 中放大图像的一部分。 为了在 html 中只显示部分图像,我在第一条评论中写了一段代码。 我想放大显示的 part.How 可以吗?
<!DOCTYOE html>
<html>
<head>
<style>
.container {
position: relative;
}
#clip {
position: absolute;
clip: rect(0, 120, 80px, 0);
/* clip: shape(top, right, bottom, left); NB 'rect' is the only available option */
}
</div>
</style>
</head>
<div class="container"> <img src="images10.png" /> </div>
<div class="container"> <img id="clip" src="images10.png" /> </body>
</html>
您可以试试下面的代码,它会缩放指定的部分:
#clip { zoom: 150%; }
仅供参考:More info here