views:

2727

answers:

2

Hello,

I am wondering if its possible to remove the default blue and yellow glow when I click on a text input / text area using CSS?

Thank you for your time.

+19  A: 
textarea, input{ outline:none;}

Although, it's been argued that keeping the glow/outline is actually beneficial for accessibility as it can help users see which Element is currently focused.

ajm
Perfect, thankyou very much. Also wondering, can I remove the textarea resize option also (at the bottom right of textarea)?
Alec Smart
+1 for the caution; *please* try to avoid doing anything which breaks the user's expectation of how their platform performs; you may actually be harming their productivity and making your web site harder to use.
Rob
Yes, set the max-height and max-width.
Tyler Rash
max-whatever do not work in IE6, if I'm not mistaking
marcgg
and @ajm, thanks! I didn't know that, I thought it was here to stay with no way to fix it.
marcgg
Remove my chrome/safari textarea resize option at your own peril! I find it really useful, indispensible even on some sites.
JeeBee
Am not removing the resize option, but thought it would be good to know just in case :)
Alec Smart
@Marc G: That isn't relevant here. The question was about disabling the textarea resize feature in Safari and Chrome -- a feature that doesn't exist in IE.
Tyler Rash
Very interesting, this outline CSS rule seems to be very under-used.
Liam
+3  A: 

On textarea resizing in webkit based browsers:

Setting max-height and max-width on the textarea will not remove the visual resize handle. Try:

resize: none;

(and yes I agree with "try to avoid doing anything which breaks the user's expectation", but sometimes it does make sense, i.e. in the context of a web application)

To customize the look and feel of webkit form elements from scratch:

-webkit-appearance: none;
Thomas Maas