我有一些在Chrome和Firefox中看起来不错的CSS,但是在Safari中出现了一个特定的问题。这三个div / ul项目在Chrome和Firefox中正确对齐,但在Safari中直接堆叠在一起。为了使它在Sf中看起来正确,我可以使三个之间的左边距逐渐变大,但FF和Chrome的结果是div远离页面。我尝试了一些黑客,包括这个:
@media screen and (-webkit-min-device-pixel-ratio:0){}
这没有改变任何事情。所以这是相关的HTML:
<ul id="nav">
<li class="nav_item"><div id= "work"> </div></li>
<li class="nav_item"><div id="about"> </div></li>
<li class="nav_item"><div id="contact"> </div></li>
</ul>
......还有CSS:
#work{ height: 50px;
width: 68px;
font-family: Helvetica, Arial, sans-serif;
font-size: 24px;
background-color: none;
background-image: url(work_1.png);
background-repeat: no-repeat;
background-size: 120%;
position: fixed;
text-align: center;
z-index: 201;
padding: 0px 0px 0px 0px;
margin: 1px 1px 1px 40px;
display: block;
clear: both;
float:right;}
#about{ height: 50px;
width: 68px;
font-family: Helvetica, Arial, sans-serif;
font-size: 24px;
background-color: none;
background-image: url(about.png);
background-repeat: no-repeat;
background-size: 120%;
position: fixed;
text-align: center;
z-index: 201;
padding: 0px 0px 0px 0px;
margin: 1px 1px 1px 40px;
display: block;
clear: both;
float: right;}
#contact{ height: 50px;
width: 84px;
font-family: Helvetica, Arial, sans-serif;
font-size: 24px;
background-color: none;
background-image: url(contact.png);
background-repeat: no-repeat;
background-size: 100%;
position: fixed;
text-align: center;
z-index: 200;
padding: 0px 0px 0px 0px;
margin: 1px 1px 1px 40px;
display: block;
clear: both;
float:right;}
#nav {
padding: 0px;
display:inline;
list-style-type:none;
margin: 30px 0px 0px 700px;
position:fixed;
width:600px;
}
.nav_item {
display:inline !important;
position:relative !important;
margin: 5px 5px 5px 150px;
width:100px;
display: inline !important;
}