Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html CSS:;溢出:隐藏";不';行不通_Html_Css_Web - Fatal编程技术网

Html CSS:;溢出:隐藏";不';行不通

Html CSS:;溢出:隐藏";不';行不通,html,css,web,Html,Css,Web,这是我的代码: .image4 { position: absolute; top: 10px; width: 100%; /* for IE 6 */ margin-right: 30px; display: inline-block; float: right; overflow: hidden; } img{ -webkit-transition: all .2s ease; -moz-transition: all

这是我的代码:

.image4 {
    position: absolute;
    top: 10px;
    width: 100%; /* for IE 6 */
    margin-right: 30px;
    display: inline-block;
    float: right;
    overflow: hidden;
}

img{
    -webkit-transition: all .2s ease;
    -moz-transition: all .2s ease;
    -ms-transition: all .2s ease;
    -o-transition: all .2s ease;
    transition: all .2s ease;

    vertical-align: middle;
}
img:hover {
    transform:scale(1.5);
    -ms-transform:scale(1.5); /* IE 9 */
    -moz-transform:scale(1.5); /* Firefox */
    -webkit-transform:scale(1.5); /* Safari and Chrome */
    -o-transform:scale(1.5); /* Opera */
}
这就是结果:

正如你所看到的,右边没有溢出。我想要的是,照片将缩放而不改变照片的大小

overflow: hidden;

这不是你要找的。页面不知道图像是否溢出,因为这就是图像宽度的大小。尝试缩小图像

使用固定宽度,并通过
max width
将其限制为100%。如果您可以发布代码片段,我们将很容易回答您的问题。很高兴为您提供帮助:)