Default submit button style for form

2019-08-04 10:20发布

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

4条回答
Rolldiameter
2楼-- · 2019-08-04 10:42

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

查看更多
爷的心禁止访问
3楼-- · 2019-08-04 10:49

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.

查看更多
做个烂人
4楼-- · 2019-08-04 10:50
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.

查看更多
走好不送
5楼-- · 2019-08-04 10:54

Kinda hackish, but definitely works..

<input type='submit' onfocus="blur()" />
查看更多
登录 后发表回答