Reputation: 28294
I have a button which I want at a certain poistion on the screen. Problem is in firefox its a little up and in IE its a little down. What can I do?
.btn1{
clear: both;
margin-top: 4%;
margin-bottom: 0px;
margin-right: 0px;
margin-left: 740px;
}
Upvotes: 0
Views: 231
Reputation: 490
You need to use a "CSS reset"... Google for it :-) Every Browser has his own default CSS, thats the problem ;-)
Upvotes: 0
Reputation: 6127
Have you in your HTML code this?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Use specified stylesheets:
<!--[if IE]>
<link rel="stylesheet" href="ie.css" />
<![endif]-->
Do you know that you can use: margin: 4% 0px 0px 760px;
?
If you want to make something horizontally-center use: margin: 0px auto;
. Cause 760px may crash in lower/higher resolutions.
Upvotes: 0
Reputation: 5720
The reason you are seeing differences between browsers is because you are using %. % is calculated and rounded differently between different browsers. Try using px or pt
Upvotes: 1
Reputation: 139
Do a normal stylesheet that makes it work on just Firefox. Then, do this:
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="your-stylesheet-here.css" />
<![endif]-->
Make this stylesheet a specific one for IE, so that the box looks correct on IE.
Upvotes: 0