tags:

views:

100

answers:

2

Hi guys,

I have a problem with css and FF3 / IE7 and Opera 10.

I have one input[type="submit"] and one anchor and I want to style them the same. No matter what I try the only logical browser seems to be Opera 10 (it styles them the same with the same css).

FF seems to have different padding (I would need to have the submit box 1px smaller in padding to fit but that would throw Opera 10 off) and IE7 is just way off.

code for you code lovers:

<form action="/login" method="post" id="loginform">
    <fieldset>
     <input type="submit" value="Login" />
     <a href="/register">Register</a>
     <a href="/reminder">Lost Password?</a>
</fieldset>
</form>

css:

fieldset a {
 color: #ffcc00;
 border: 1px solid #707070;
 background: #000000;
 font-size: 10px;
 font-weight: normal;
 padding: 2px;
 /*vertical-align: text-top;*/
}
fieldset a:hover {
 color: #ffcc00;
 border: 1px solid #707070;
 background: #333333;
 cursor: pointer;
 font-size: 10px;
 font-weight: normal;
 text-decoration: none;
 padding: 2px;
}
fieldset input[type="submit"] {
 color: #ffcc00;
 padding: 2px;
 border: 1px solid #707070;
 background: #000000;
 font-size: 10px;
 font-weight: normal; 
}
fieldset input[type="submit"]:hover {
 color: #ffcc00;
 padding: 2px;
 border: 1px solid #707070;
 background: #333333;
 cursor: pointer;
 font-size: 10px;
 font-weight: normal;
}

any help to solve the issue of alignment between browsers is desired as I need to support all three (safari too but I think if I get these 3 aligned it should work there too).

Many thanks in advance (p.s I'm going on lunch now and will check answers right after so sorry for the slow replies in advance)

A: 

Try this in isolation. I recommend using a reset.css file to force all browsers to treat apples as apples, and then styling your INPUT and A elements accordingly.

It's possible that other CSS rules are coming into the mix.

See http://meyerweb.com/eric/tools/css/reset/ for a reset file.

I've had issues with the past with IE and styling certain elements (specifically disabled elements), and how IE differs in its handling of this styling between versions 6 and 7.

The following DOCTYPE seemed to help in those circumstances, but rendering in IE 6 may no longer work as expected:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;
David Andres
Now this is an interesting and great idea David. I'll read up on it right away
Dorjan
Unfortunately this doesn't reset the buttons :(
Dorjan
Try adding a strict DOCTYPE to your page and load it in IE 7. Quirks mode may be impacting your styling. Certain things aren't styled well with IE...especially version 6.
David Andres
I already have a doctype :)
Dorjan
+1  A: 

The Firefox problem is solved like this

button::-moz-focus-inner { 
  border: 0;
  padding: 0;
}
n1313
This does solve one of the issues so +1 here :D
Dorjan
Is there a place with all these commands? -moz- or even for Opera/IE?
Dorjan
Well, I'd suggest reading internal css files of your useragent...
n1313
how do you do that n1313?
Dorjan
Hmm, for Firefox on Windows try looking for *.css in C:\Program Files\Mozilla Firefox\res. For other browsers and OSes, try googling :)
n1313