gpt4 book ai didi

html - CSS3 和 HTML5 ;过渡不起作用

转载 作者:行者123 更新时间:2023-11-28 03:51:37 25 4
gpt4 key购买 nike

我在 HTML、CSS 和过渡属性、过渡持续时间、过渡计时功能属性上做一些事情对我的元素不起作用。我用了每一个 -webkit- 、 -moz- 、 -o- 和其他的都不起作用。我确实卸载了谷歌浏览器并重新安装了它,但没有用。我的代码:

索引.php:

<?php

include "function/baglanti.php";

?>

<html>

<head>

<title>Deneme | Anasayfa</title>

<link rel="stylesheet" href="style/main.css" />

</head>

<body>

<div id="den">sshshsh</div>

</body>

</html>

主.css:

#den
{
width: 100px;
height: 100px;
background-color: red;
}

#den:hover
{
width: 200px;
transition: width 0.5s linear;
}

最佳答案

为了双向工作,将 transition 属性移动到 #den 规则

#den
{
width: 100px;
height: 100px;
background-color: red;
transition: width 0.5s linear; /* moved it here and it work both ways */
}

#den:hover
{
width: 200px;
}
<div id="den">sshshsh</div>

关于html - CSS3 和 HTML5 ;过渡不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43697622/

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