Forum Moderators: not2easy
<snip -- No URLs, thanks. We know what you mean, so no example needed.>
How do I get the submit buttons to look the same in both browsers?
Is there a CSS hack for IE--so that it will render the Submit button properly?
[edited by: DrDoc at 5:38 am (utc) on Oct. 3, 2006]
In your normal stylesheet, set however much padding you want for your standards-compliant browsers, to match IE as you wish :)
[edit]
Oh, I almost forgot: No dropping URIs like that - see the Webmaster World Terms of Service [webmasterworld.com] and the CSS Forum Charter [webmasterworld.com].
[/edit]
[edited by: Setek at 3:57 am (utc) on Oct. 3, 2006]
Unfortunately, I have no idea how to use a conditional comment.
I'll use an embedded style as an example for you :)
What should the code look like to solve the IE display problem?
<style type="text/css">
<!--
input.button { padding: 2px 8px; } /* INPUTS WITH CLASS BUTTON */
-->
</style>
<!--[if lte IE 6]>
<style type="text/css">
input.button { padding: 2px 0px; }
</style>
<![endif]--> You can also use this as multiple external stylesheets:
<link rel="stylesheet" type="text/css" media="screen" href="/includes/mynormalstylesheet.css" />
<!--[if lte IE 6]><link rel="stylesheet" type="text/css" media="screen" href="/includes/ie.css" /><![endif]--> Keep note: as the styles from anything above the conditional comment come first, they will be loaded first, then the conditional comment styles/stylesheet will load after and override.
Setek nice explanation on conditional comments, however simply changing the padding for IE won't cut it if I remember.
IE doesn't respect padding here, the amount of space on the left and right of the input value is directly related to the length of the string. and at one point suggestions were made [webmasterworld.com] as to how to detect that string length to incorporate a JS or PHP solution.
hadn't looked at in a while but a rework of an older IE solution seems to work? Feel free to test and see what happens in various browsers I haven't tested them all
If overflow causes a problem to other browsers (it shouldn't as there's no width/heights) then it could be hidden in a general IE conditional comment.
input.button {
padding: 2px 5px; /* whatever your required padding is */
overflow: visible; /* seems to keep IE (inc 7) in check without anything else */
}HTML:
<input type="submit" class="button" value="yes, click me for much more information" />
Suzy
Suzy, thank you for your answer. I understand your solution, and best of all, it worked!
In my stylesheet, I used:
input.button {
max-width: 260px;
width: 260px;
padding: 1px 4px; /* whatever your required padding is */
overflow: visible; /* seems to keep IE (inc 7) in check without anything else */
}
.button {
font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 12px;
}
I discovered that if I didn't use "max-width" and "width" then IE created extra white space between the text (i.e. First Name) and the input text field.
In the HTML:
<input type="submit" class="button" name="submit" value="Send me the WXYZ Guide"> </td></tr>
Lots of good ideas in the other thread. Thank you everyone.
P.S. I wasn't aware of the policy on URL's. I was simply trying to demonstrate the problem visually. This board is unusual in regard to its policy on using URL's. Most boards allow URL's, as long as they're not affiliate links or blatant advertising/self-promotion.