Thanks Patrick
Specificity was the problem, and i grabbed your Javascript to make it work in IE as well :-)
Is there a name for what your javascript does, someone was trying to explain applications of the DOM to me the other day, would this be an example of that?
-- Neerav Bhatt http://www.bhatt.id.au Web Development & IT consultancy Mobile: +61 (0)403 8000 27
http://www.bookcrossing.com/mybookshelf/neerav
Patrick Griffiths wrote:
*****************************************************Neerav wrote:
problem where the change in background-color on focus works on all but one element ( #full_name ) in Firefox & Opera.
#contactus #full_name, #email_address, #referral,
#phonenumber_website,
#inquiry { background-color: #0099ff; color: #000000; }
It's to do with specificity ("#contactus #fullname" beats "#contactus input:focus" in a fight). Just pull out "#contactus" from the above rule.
And, on a side note, if you want :focus to work in IE, try this: http://htmldog.com/articles/suckerfish/focus/
Patrick
---------------- Patrick Griffiths (PTG) http://www.htmldog.com/ptg/ http://www.htmldog.com
----- Original Message ----- From: "Neerav" <[EMAIL PROTECTED]> To: "WSG" <[EMAIL PROTECTED]> Sent: Tuesday, June 22, 2004 9:15 AM Subject: [WSG] :focus not applying to all elements in form
Hi
I've been experimenting with :focus on form elements (input &
textarea)
at http://www.bhatt.id.au/contactus.php , but have struck a strange problem where the change in background-color on focus works on all but one element ( #full_name ) in Firefox & Opera.
Of course in IE theres no difference either way as it doesnt support :focus but thats another matter
The relevent css is below, the html can be seen by viewing the source
of
http://www.bhatt.id.au/contactus.php
#contactus #full_name, #email_address, #referral,
#phonenumber_website,
#inquiry { background-color: #0099ff; color: #000000; }
#contactus input:focus { background-color: #ffffff; }
#contactus textarea:focus { background-color: #ffffff; }
I have validated the XHTML and CSS code and it is fine so im
scratching
my head over this one...
-- Neerav Bhatt
The discussion list for http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
*****************************************************
