:focus pseudo class (highlight form element onFocus)Author: CSS Drive
The ":focus" CSS puesdo class applies the style to an element when the user sets focus on it. Using it, for example, you can easily highlight the form element the user is currently typing in. Note that ":focus" is currently not supported in Internet Explorer (as of IE 6.0), but is in Mozilla/ NS7+.
The HTML:
<form>
<p>1) Name:<br />
<input type="text" size="40"></p>
<p>2) Email address:<br />
<input type="text" size="40"></p>
<p>3) Comments:<br />
<textarea rows="5" name="comments" cols="45" wrap="virtual"></textarea></p>
<p><input id="actualsubmit" type="submit" value="Submit"></p>
</form>
The CSS:
input:focus, textarea:focus{
background-color: lightyellow;
}
Funny, lol You said read the page before posting, but you should read posts before commenting:
(as of IE 6.0) is what it says, and Joey was commenting about IE7.
mmm nice
css textboxt input (textfield) style - examples - -
http://www.css-lessons.ucoz.com/textbox-css-examples.htm
The input:focus highlighting stuff is really cool!
Thanks.
Annoucement: I'm looking for a few news posters. Interested?
| CSS Forums: latest threads | Last Post Info |
|---|---|
| Nested Lists and display: (2) | 07/04/2008 02:31 pm |
| List your resource websites! (1) | 07/03/2008 07:17 pm |
| Free Wordpress Theme Heaven (1) | 07/03/2008 11:08 am |
| Free Wordpress Theme Purple Butterfly (1) | 07/02/2008 04:05 pm |
| Alignment Issues (2) | 07/01/2008 09:03 am |