Why is it like this in different browsers?
Screenshots:
- Preview in Chrome
- Preview in Firefox
How can I fix the difference? Here is my CSS code:
BODY
{
margin: 0;
padding: 0;
background-image:url('images/bg.jpg');
}
@font-face {
font-family: "District";
font-style: normal;
font-weight: 1;
src: url("DisTh__.otf");
}开发者_如何学C
#logo
{
padding-top: 0;
line-height: 0%;
font-family: District;
font-size: 36px;
color:#d8d8d8;
text-decoration: none;
text-shadow: #000000 1px 1px 1px;
float:left;
}
#main-container
{
width:980px;
margin-left:auto;
margin-right:auto;
padding-top: 0px;
border-style:solid;
border-width:2px;
}
#nav
{
float: right;
Width: 500px;
padding-top:26px;
}
#nav li
{
line-height: 22px;
font-family: District;
font-size: 18px;
text-align:center;
color:#d8d8d8;
list-style-position:inside;
list-style-type: none;
float: right;
padding-right: 30px;
}
#nav li a
{
text-decoration:none;
text-shadow: #000000 1px 1px 1px;
color:#d8d8d8;
}
#nav li a:hover
{
text-decoration:none;
text-shadow: #000000 2px 2px 1px;
}
#middle-container
{
width:980px;
margin-left:auto;
margin-right:auto;
margin-top: -4px;
background-image:url(images/box-bg.jpg);
background-repeat:no-repeat;
}
#clear
{
clear:both;
}
/* SLIDER CSS */
#slideshow {
margin: auto;
width:980px;
height:450px;
background:transparent url(images/box-bg.jpg) no-repeat 0 0;
position:relative;
}
#slideshow #slidesContainer {
width:568px;
height:225px;
overflow:auto; /* allow scrollbar */
position:relative;
top: 47px;
}
#slideshow #slidesContainer .slide {
width:568px; /* reduce by 20 pixels of #slidesContainer to avoid horizontal scroll */
height:263px;
}
/**
* Slideshow controls style rules.
*/
.control {
display:block;
width:39px;
height:263px;
text-indent:-10000px;
position:absolute;
cursor: pointer;
}
#leftControl {
top:0;
left:0;
background:transparent url(images/Lprev-button.png) no-repeat 0 0;
margin-top:116px;
margin-left: 85px;
}
#rightControl {
top:0;
right:0;
background:transparent url(images/Rnext-button.png) no-repeat 0 0;
margin-top:116px;
margin-right: 85px;
}
/* END SLIDER */
This answer wont solve the problem directly, but it will help to avoid problems like this occurring. You should use a reset.css, this will reset all browsers to the same base styles. Eric Mayers is particularly good - http://meyerweb.com/eric/tools/css/reset/.
Using this doesnt mean you'll never have to use any hacks, but its a GREAT start.
精彩评论