#someDiv input:hover,
#someDiv input:active {
background: #FFF5C1;
}
The above CSS code will allows the background of an input box to change while the user moves their mouse over and clicks on the box itself.
However, when the user starts typing in the box and moves their mouse away from the box the background changes back to a default #FFFFFF (white).
What would I need to do in order for the colour to stay #FFF5C1 (yellow) when the user is typing in the box as well? As I've mentined before I already have the :hover and :active set up in my CSS syntax.I believe you'll need Javascript for that one.#someDiv input:hover, #someDiv input:active, #someDiv input:focus {
background: #FFF5C1;
}
Keeping in mind, this only works with browsers advanced enough to support pseduo classes on elements other than links (i.e. not Internet Explorer).Thanks guys.
Considering many people still use IE, I will need it to be compatible with that browser as well. I thought it'd be possible with CSS and without JavaScript. Well off to find a JS solution for this...This is one of many reasons why IE6 is a second rate browser -- it has a serious lack of CSS2 support.
Take a look at these:
<!-- m --><a class="postlink" href="http://dean.edwards.name/IE7/">http://dean.edwards.name/IE7/</a><!-- m -->
<!-- m --><a class="postlink" href="http://www.htmldog.com/articles/suckerfish/">http://www.htmldog.com/articles/suckerfish/</a><!-- m -->
whatever:hover (<!-- m --><a class="postlink" href="http://www.xs4all.nl/~peterned/csshover.html">http://www.xs4all.nl/~peterned/csshover.html</a><!-- m -->)
#someDiv input:active {
background: #FFF5C1;
}
The above CSS code will allows the background of an input box to change while the user moves their mouse over and clicks on the box itself.
However, when the user starts typing in the box and moves their mouse away from the box the background changes back to a default #FFFFFF (white).
What would I need to do in order for the colour to stay #FFF5C1 (yellow) when the user is typing in the box as well? As I've mentined before I already have the :hover and :active set up in my CSS syntax.I believe you'll need Javascript for that one.#someDiv input:hover, #someDiv input:active, #someDiv input:focus {
background: #FFF5C1;
}
Keeping in mind, this only works with browsers advanced enough to support pseduo classes on elements other than links (i.e. not Internet Explorer).Thanks guys.
Considering many people still use IE, I will need it to be compatible with that browser as well. I thought it'd be possible with CSS and without JavaScript. Well off to find a JS solution for this...This is one of many reasons why IE6 is a second rate browser -- it has a serious lack of CSS2 support.
Take a look at these:
<!-- m --><a class="postlink" href="http://dean.edwards.name/IE7/">http://dean.edwards.name/IE7/</a><!-- m -->
<!-- m --><a class="postlink" href="http://www.htmldog.com/articles/suckerfish/">http://www.htmldog.com/articles/suckerfish/</a><!-- m -->
whatever:hover (<!-- m --><a class="postlink" href="http://www.xs4all.nl/~peterned/csshover.html">http://www.xs4all.nl/~peterned/csshover.html</a><!-- m -->)