我有一个<div>, 来显示文本。并为<div>. 我想<div>在更改文本时设置动画。我如何更改css
HTML
<div id="location-name-container">
<div id="location-name"></div>
</div>
document.getElementById('location-name').innerHTML = "Hello"
CSS
#location-name {
align-self: center;
width: 540px;
max-height: 100px;
color: #FFFFFF;
-webkit-text-stroke-color: #000000;
font-size: 42px;
line-height: 50px;
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
animation: fade-in 200ms;
}
@keyframes fade-in {
from { opacity: 0; }
to { opacity: 1; }
}
@keyframes fade-out {
from { opacity: 1; }
to { opacity: 0; }
}
慕斯王
慕尼黑8549860
吃鸡游戏
慕后森
相关分类