【问题标题】:How to zoom part of an image in html?如何在html中缩放图像的一部分?
【发布时间】:2016-06-12 03:12:05
【问题描述】:

我想在 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>

【问题讨论】:

标签: html css image zooming


【解决方案1】:

你可以试试下面的代码来缩放指定的部分:

#clip { zoom: 150%; }

仅供参考:More info here

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-12-01
    • 2015-05-09
    • 2012-11-15
    • 2014-04-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多