gpt4 book ai didi

html - 如何在html中缩放图像的一部分?

转载 作者:太空宇宙 更新时间:2023-11-04 10:42:15 25 4
gpt4 key购买 nike

我想在 html 中缩放图像的一部分。为了在 html 中仅显示部分图像,我在第一条评论中编写了代码。我想放大这个显示的部分。我该怎么做。

<!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中缩放图像的一部分?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35693474/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com