Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing the color of the text and cursor in input box

Tags:

html

css

When a user clicks in the box below, the cursor and typed text are black. How could I make them the color of #DE2A00 ?

<div class="usernameformfield"><input tabindex="1" accesskey="u" name="username" type="text" maxlength="35" id="username" /></div> 
like image 999
John Avatar asked Nov 16 '11 23:11

John


People also ask

How do I change the color of the input field cursor?

Use color to specify the text color. Use caret-color to specify the caret's color. This should be the answer now.


1 Answers

Just use CSS:

#username{color:#000;} /* black when not with focus */
#username:focus{color:#de2a00;} /* green when input has focus - only affects this specific input */
like image 162
Dean Marshall Avatar answered Oct 05 '22 11:10

Dean Marshall