[英]Stopping marquee with css
有什么办法可以阻止CSS
marquee
吗? 出于安全原因,我无法使用javascript
。
如何使用CSS做到这一点?
编辑:我想在鼠标悬停时停止它,否则启动它。
的HTML
<p class="microsoft marquee"><span>Windows 8 and ...</span></p>
的CSS
.marquee {
width: 450px;
margin: 0 auto;
white-space: nowrap;
overflow: hidden;
box-sizing: border-box;
}
.marquee span {
display: inline-block;
padding-left: 100%; /* show the marquee just outside the paragraph */
animation: marquee 15s linear infinite;
}
.marquee span:hover {
animation-play-state: paused
}
/* Make it move */
@keyframes marquee {
0% { transform: translate(0, 0); }
100% { transform: translate(-100%, 0); }
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.