当用户单击下面的框中时,光标和键入的文本为黑色。我怎样才能使它们成为 #DE2A00
的颜色?
<div class="usernameformfield"><input tabindex="1" accesskey="u" name="username" type="text" maxlength="35" id="username" /></div>
最佳答案
只需使用 CSS:
#username{color:#000;} /* black when not with focus */
#username:focus{color:#de2a00;} /* green when input has focus - only affects this specific input */
关于html - 更改输入框中文本和光标的颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8160363/