gpt4 book ai didi

css - 带溢出的过渡图像

转载 作者:行者123 更新时间:2023-11-28 05:11:54 24 4
gpt4 key购买 nike

我正在尝试在图像上使用过渡。这是我想要它做的。悬停时,图像的大小应增加到 400 x 400 像素的宽度。

我不希望它在转换时做的是:

(1) 影响页面上的任何其他元素。

(2) 当图像超过其原始大小时隐藏图像(我遇到溢出:隐藏;问题。)

这是我的代码,已被放入另一个文档中,因此我可以在不查看所有其余代码的情况下对其进行处理。

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>

<body>
<style>
#test img {width:358px;
height:298px;
transition: all 1s ease;
overflow: hidden;}

#test:hover img {width: 450px;
height:400px;}
</style>

<div id="test">
<img src="Portfolio/Hair_Salon/images/stylist1.png">
</div>
</body>
</html>

最佳答案

我一想到我在这里输入的内容就想通了......

我需要再添加一个标识符#test {width:358px, height:298px;溢出:隐藏;}

关于css - 带溢出的过渡图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39505872/

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