IE7 and FFox seem to render textboxes very slightly differently by default.
This seems to be fixed by setting their border-style and border-width css properties.
The odd thing is, it seems that out of all the options vstudios intellisense gives me, none of them match?
The closest I've found is
border-width:1px;
border-style:inset;
Edit: Trying to set the style for a textbox, they all appear to render differently in various browsers.
According to Firebug, the default style for a textbox in Firefox is
border: 2px inset #EBE9ED;
This is the first question/result that comes up via Google when looking for this sort of thing, so I thought I'd provide the answer I was looking for personally.
the answer is to set the style to '' or "";
If this is unclear, I am providing an example involving javascript/jquery, assuming you get that at a basic level. Naturally, the box starts off at a default. Let's assume I change it with code to be red, when someone clicks on that textbox...
$("#phoneBox").focus(function(){
document.getElementById('telephone').style.border = '1px solid red';
}
That will set it to red someone clicks into that textbox. Now, however, let's assume I want to set it back to normal when someone clicks away from the box
$("#phoneBox").blur(function(){
document.getElementById('telephone').style.border = '';
}
The box will go back to the default style, since it has no values to go off of.
In your CSS, just
border:'';
or to be thorough,
border-style:'';
border-width:'';
border-color:'';
will render the default in any browser. I hope that this makes sense/helps others.
Maybe you will not believe me, but I try this:
<input style="border:default">
and it works in Windows Internet Explorer 8, Firefox 3.6.22 and Chrome 14.0.835
I think <input style="border:XXX"> <input style="border:XXX">
works too. The point is that if you use an invalid border style, then the input box goes back to its default border style.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With