所以我网站上的 CSS 似乎不起作用,至少我所做的更新是这样。我想使用 css transition 属性和 JQuery.css 属性创建高度过渡效果,但我应用的更改在我的网站上不起作用。
.blog{
transition: 1500ms ease-in-out !important;
width: 100%;
height: 0% !important;
background-color: #8394EB;
margin: 0;
padding: 10px 40px;
color: white !important;
}
$('.blog').css('height','100%');
最佳答案
使用 %
设置 height
在很多情况下可能不起作用。
尝试在 css 和您的 js 代码中使用 px
、rem
或 vh
,看看是否有任何不同。
.blog{
transition: 1500ms ease-in-out !important;
width: 100%;
height: 0px;
background-color: #8394EB;
margin: 0;
padding: 10px 40px;
color: white !important;
}
$('.blog').css('height','10vh');
关于javascript - CSS 和 JQuery 不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44933547/