我的页面顶部有这些按钮,问题是 chrome 显示这些按钮时向右多了 80 像素。我做错了什么?
这是一个按钮的样式:
#engleza1{
position: relative;
top:0px;
left: 788px;
width: 51px;
height:42px;
}
#engleza1:hover{
position: relative;
top:0px;
left: 788px;
width: 51px;
height:42px;
background:url(../images/engleza.png) no-repeat;
cursor: pointer;
}
这是他们包装器的样式:
#wrap{
width:100%;
height: 1950px;
text-align: center;
margin:0 auto;
overflow: hidden;
background:url(../ong.png) center no-repeat;
}
html:
<div id="wrap">
<div id="engleza1">
//nothing here
</div>
...
</div>
最佳答案
您好,您的一些代码是重复的,所以请移动它并替换它
#wrap{
height: 1950px;
text-align: center;
margin:0 auto;
overflow: hidden;
background:red;
}
#engleza1{
position: relative;
top:0px;
left:788px;
width: 51px;
height:42px;
background:yellow;
}
#engleza1:hover{
background:green;
cursor: pointer;
}
根据您的布局更改演示
关于css - chrome 定位与 firefox 不同的元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12472522/