views:

308

answers:

4

Now I know this issue is over-talked about but I cannot seem to find a question that addresses this little gem directly so here goes...

In Opera and IE when a form has focus the default submit input gets some sort of highlight. Like outline is when you have tab focused onto an element.

However, unlike the tab one (dotted lines inside or around which to me is nice and user friendly and so WANT it for my users) this one has some bizarre designs...

Firefox has its own problems but at least you can customise it. It reserves the space for the "highlight"/"border" or whatever you want to call it which means that your input will be bulker than any other browser. - why can't it do what it does for the anchors and have the highlight around the blasted thing?

Opera is odd in itself (Opera 10) since it makes the outline "highlight" whatever black. Now this isn't an issue UNLESS YOU HAVE A BLACK BACKGROUND... and it replaces the original border which is just palmface worthy... what were they thinking.

IE is like Firefox but no known way to customise it..

Now for the question: Is there a way to set the bloody colour in Opera for this focus event (which would solve that issue) or to have it in firefox without having to bloat the design in every other browser or a way to make IE conform at all.

Many thanks in advance

A: 
button:active{background-color:#f00;}
button:hover{background-color:#0f0;}

That should allow you to control the visual interaction of a button. To target a specific button provide an id value in your HTML on the button tag.

active you say.. hmm... I'll look into that.
Dorjan
So far active has done nothing...
Dorjan
A: 

try doing

<input type='submit' autocomplete='off' style='outline:none;'/>

this worked for me in text fields - I'm not sure if it carries over to submit or button elements but it's worth a try.

Mikey
Unfortunately this doesn't work for all browsers. many thanks though.
Dorjan
A: 

I tried and tried but I don't think this is possible.

Dorjan
Voted down on this? Please oh please whoever voted me down answer the question.
Dorjan
yah what's up with that dude, +1 on your answer and +1 on your comment... Also I think you're right because I've having the same issue and it seems that you cannot prevent the default behavior. BTW, I wish that people on Stackoverflow would grow up and not down vote people because they are bitter about something.
Joseph Silvashy
Thanks jpsivashy :)I hate the fact that all browsers have a unique way of doing buttons and also do not let us in on all the features from CSS.Oh well.
Dorjan
A: 

Kinda hackish, but definitely works..

<input type='submit' onfocus="blur()" />
Matt