本文介绍了如何改变textarea on:focus的边框颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

原谅我是一个愚蠢的问题,但我需要帮助。
我想改变TEXTAREA在焦点上的边框颜色。但我的代码似乎无法正常工作。



请在。

 < form name =myformmethod =postaction =insert.phponsubmit =return validateform()style =width:40%> 
< input type =textplaceholder =输入名称。 name =namemaxlength =300class =input>
< input type =emailplaceholder =输入电子邮件。 name =addressmaxlength =300class =input>
< textarea placeholder =输入消息。 name =descripclass =input>< / textarea>
< br>
< input class =button secondarytype = submit name =submitvalue =Submit>
< / form>

以下是CSS

  .input {
border:0;
padding:10px;
font-size:1.3em;
font-family:Ubuntu Light,Ubuntu,Ubuntu Mono,Segoe Print,Segoe UI
color:#ccc;
border:solid 1px #ccc;
margin:0 0 20px;
width:300px;
-moz-box-shadow:inset 0 0 4px rgba(0,0,0,0.2);
-webkit-box-shadow:inset 0 0 4px rgba(0,0,0,0.2);
box-shadow:inner 0 0 4px rgba(0,0,0,0.2);
-webkit-edge-radius:3px;
-moz-border-radius:3px;
border-radius:3px;

}
输入:focus {
outline:none!important;
border-color:#719ECE;
box-shadow:0 0 10px#719ECE;
}


解决方案
  .input:focus {
outline:none!important;
border:1px solid red;
box-shadow:0 0 10px#719ECE;
}


Forgive me is this is a stupid question, but i need help.I want to change border color of TEXTAREA on focus. but my code doesn't seem to working properly.

Kindly view code on fiddle.

<form name = "myform" method = "post" action="insert.php"  onsubmit="return validateform()" style="width:40%">
        <input type="text" placeholder="Enter Name." name="name" maxlength="300" class="input">
        <input type="email" placeholder="Enter E-mail." name="address" maxlength="300" class="input">
        <textarea placeholder="Enter Message." name="descrip" class="input" ></textarea>
<br>
<input class="button secondary" type=submit name="submit" value="Submit" >
</form>

Here is the CSS

.input {
border:0;
padding:10px;
font-size:1.3em;
font-family:"Ubuntu Light","Ubuntu","Ubuntu Mono","Segoe Print","Segoe UI";
color:#ccc;
border:solid 1px #ccc;
margin:0 0 20px;
width:300px;
-moz-box-shadow: inset 0 0 4px rgba(0,0,0,0.2);
-webkit-box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.2);
box-shadow: inner 0 0 4px rgba(0, 0, 0, 0.2);
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;

}
input:focus {
    outline: none !important;
    border-color: #719ECE;
    box-shadow: 0 0 10px #719ECE;
}
解决方案
.input:focus {
    outline: none !important;
    border:1px solid red;
    box-shadow: 0 0 10px #719ECE;
}

http://fiddle.jshell.net/ffS4S/3/

这篇关于如何改变textarea on:focus的边框颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-30 08:55