html - 如何在IE上有跑马灯效果?

标签 html css internet-explorer google-chrome firefox

以下是适用于 chrome 和 firefox 的选取框。但它不适用于 Internet Explorer。这是为什么 ?我怎样才能让它发挥作用?这是 jsfiddle

HTML

<p class="marquee">
    <span>
        Hey! What's up? <br />
        Second Line <br />
        Third Line <br />
        Fourth Line <br />
        Fifth Line <br /    
    </span>

CSS

    /* define the animation */
@-webkit-keyframes marquee {
  0%   { -webkit-transform: translate(0, 0); }
  100% { -webkit-transform: translate(0, -100%); }
} 
@-moz-keyframes marquee {
  0%   { transform: translate(0, 0); }
  100% { transform: translate(0, -100%); }
} 


/* define your limiting container */
.marquee {
  border: solid 2px;
  white-space: nowrap;
  overflow: hidden;
  border-color: #0aa2e3;
  box-sizing: border-box;
  height:60px;
}
/* this is the tray moving around your container */
.marquee span {
  display: inline-block;
  text-indent: 0;
  animation: marquee 15s linear infinite; /* here you select the animation */
  -webkit-animation: marquee 15s linear infinite; /* here you select the animation */
}
/* pause the animation on mouse over */
.marquee span:hover {
  animation-play-state: paused;
  -webkit-animation-play-state: paused;
}

最佳答案

你只为 MOZILLAWEBKIT 添加了 keyframe vendor prefix 但没有使用标准的 @keyframes.

看看 DEMO .

    /* Standard animation */
@keyframes marquee {
  0%   { transform: translate(0, 0); }
  100% { transform: translate(0, -100%); }
} 

关于html - 如何在IE上有跑马灯效果?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25038032/

相关文章:

eclipse - 无法在 'replaceState' : A history state object with URL 上执行 'History'

css - 文章摘要中的文本溢出 '...'

css - IE8 中非常奇怪的按钮行为

javascript - 从 JavaScript 打开/保存本地 (JSON) 文件 >> IE/Firefox

internet-explorer - IE8中PNG的背景颜色

jQuery 拖动滚动禁用

html - 从特定 DIV 中删除所有 CSS

javascript - window.scrollto和scrollIntoView在ios中滚动不顺畅

css - Z 索引不起作用

css - 绝对位置高度 100% 在 IE 11 上不起作用 - 但在 Microsoft Edge 上可以