输入文本里面的CSS动画? [英] CSS animation inside of input text?

查看:72
本文介绍了输入文本里面的CSS动画?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要实现的是在输入文本中有一个选框,比如打击;

What I'm trying to achieve is have a marquee inside of a input text, like blow;

<input type="text" class="form-control" value="<marquee>Hi</marquee>" disabled></input>

我已将此标记为JavaScript,因为我认为这不可能仅使用简单的html,I但是可能会有误。

I have tagged this as JavaScript as I don't think this is possible with just plain html, I could be mistaken however.

编辑 - 也许代替过时的< marquee> 标签,我可以使用CSS动画而不是选框来在输入上创建文本滚动。

EDIT - Perhaps instead of the outdated <marquee> tag, I could use a CSS animation instead of the marquee to create the text scroll across the input.

推荐答案

CSS动画可以模仿那个功能。

CSS animations can mimic that functionality.

@-webkit-keyframes marquee {
    0% {text-indent:100%;}
    100% {text-indent:-10%}
}

input.marquee {
  -webkit-animation: marquee 5s infinite;
  -webkit-animation-timing-function: linear;
  }

<input type="text" class="form-control marquee" value="Hi" disabled ></input>

<marquee>Hi</marquee>

这篇关于输入文本里面的CSS动画?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆