求CSS代码,输入字时输入框边框闪烁

html-css014

求CSS代码,输入字时输入框边框闪烁,第1张

<style>

#oText{border:1px?dotted?#ff0000ryo:expression(?light?(){with(documen

t.all.oText){style.borderColor=(style.borderColor=="#ffee00"?"#ff0000":"#f

fee00")timer=setTimeout(light,500)}},(){this.style.borderColor="#ff0000

"clearTimeout(timer)})}

</style>

<input?type="text"?id="oText">

div{width: 200pxheight: 200pxbackground: #dadadaborder:5px solid redanimation: shine 1s alternate infinite}

@keyframes shine{

from{border-color: rgba(0,0,0,0)}

to{border-color: rgba(0,0,0,1)}

}

需要准备的材料分别有:电脑、chrome浏览器、html编辑器。

1、首先,打开html编辑器,新建html文件,例如:index.html。

2、在index.html中的<style>标签中,输入css代码:

@keyframes blink{

0%{opacity: 1}

100%{opacity: 0}

}

@-webkit-keyframes blink {

0% { opacity: 1}

100% { opacity: 0}

}

.blink{

color: #dd4814

animation: blink 1s linear infinite

-webkit-animation: blink 1s linear infinite

}

3、浏览器运行index.html页面,此时文字实现了闪烁的效果。