我在几个设备和浏览器上测试了一个网页(PC、平板、iPad、android手机),一切看起来都不错。
我发现的唯一问题是当我使用Android手机测试网页时,使用IE作为浏览器。
网页以某种方式被推到屏幕左侧,导航链接没有正确对齐。只有在android手机上使用Internet Explorer查看时才会出现这种情况。
知道为什么会发生这种情况以及如何解决吗?
以下是网页:http://www.nightaccents.com以下是CSS:
/*CSS RESET*/
html, body {
margin:0;
padding:0;
height:100%;
}
h1, h2, h3, h4, h5, h6 {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-style: inherit;
vertical-align: baseline;
}
a img {
border: none;
}
a:link {
color:#666;
text-decoration: none;
border:none;
}
a:hover {
color:#0373ED;
}
a:visited{
color:#666;
}
#container {
min-height:100%;
position:relative;
}
#header {
padding:10px;
background-color: #FFF;
}
.wrapHeader {
position:relative;
width:960px;
background-color: #FFF;
height: 149px;
margin-top: 0;
margin-right: auto;
margin-bottom: 0;
margin-left: auto;
}
.logo {
float:left;
width:297px;
height: 148px;
}
.nav {
font-size: 16px;
color: #666;
float: left;
width: 663px;
position: relative;
top: 75px;
text-transform: uppercase;
z-index: 1;
text-indent: 135px;
}
#body {
padding:10px;
padding-bottom:60px; /* Height of the footer */
}
.wrapContent {
position:relative;
width:900px;
background-color: #FFF;
height: auto;
margin-top: 0;
margin-right: auto;
margin-bottom: 0;
margin-left: auto;
line-height: 1.4;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
}
#footer {
position:absolute;
bottom:0;
width:100%;
height:60px;
background-color: #333;
padding-top: 10px;
}
#footer p {
margin:0;
padding:10px;
}
.wrapFooter {
position:relative;
width:500px;
background-color: #333;
color: #CCC;
margin-top: 0;
margin-right: auto;
margin-bottom: 0;
margin-left: auto;
text-align: center;
top: 10px;
}
</style>
<!--[if lt IE 7]>
<style media="screen" type="text/css">
#container {
height:100%;
}
</style>
<![endif]-->
由于我没有您提到的测试环境,我不能给出一个精确的解决方案,但通常情况下,当东西向左对齐时,这是因为您没有裕量:0自动;在什么东西上。这至少是我的经验。
看起来你的#容器没有这个。身体也不会。
我也会改变你所有的
margin-top: 0;
margin-right: auto;
margin-bottom: 0;
margin-left: auto;
至
margin: 0 auto;