0

我为我的网站制作了一个导航栏/菜单,并自定义了 CSS 中的颜色。它在 IE、Chrome 和 Firefox 上运行良好。但是对于 Safari,导航栏会以默认颜色显示!如果有人可以帮助我,我将不胜感激。

Internet Explorer、Firefox、Chrome:

http://tinypic.com/view.php?pic=2gtygrc&s=5

苹果浏览器:

http://i39.tinypic.com/2eltloi.png

的HTML:

    <li><a href="index.php?id">Hjem</a></li>
    <li><a href="index.php?id=1">Portfolio</a></li>
    <li><a href="index.php?id=2">Om</a></li>                
    <li><a href="">Andet</a></li>
    <li><a href="index.php?id=3">Kontakt</a></li>

CSS:

nav ul {
    margin: 80px 0 20px 0;
    padding: 0em;
    float: left;
    list-style: none;
    background: #1A1A1A;
    background: rgba(26,26,26,.2);
    -moz-border-radius: .5em;
    -webkit-border-radius: .5em;
    border-radius: .5em;    
    -moz-box-shadow: 0 1px 0 rgba(255,255,255,.2), 0 2px 1px rgba(0,0,0,.8) inset;
    -webkit-box-shadow: 0 1px 0 rgba(26,26,26,.2), 0 2px 1px rgba(0,0,0,.8) inset;
    box-shadow: 0 1px 0 rgba(26,26,26,.2), 0 2px 1px rgba(0,0,0,.8) inset; 
}

nav li {
    float:left;
}

nav a {
    float:left;
    padding: .8em 1.5em;
    text-decoration: none;
    color: #ffffff;
    text-shadow: 0 1px 0 rgba(255,255,255,.5);
    font: bold 1.1em/1 'trebuchet MS', Arial, Helvetica;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-width: 1px;
    border-style: solid;
    border-color: #d6d6d6 #d6d6d6 #d6d6d6 #d6d6d6;
    background: #000000;
    background: -moz-linear-gradient(#f5f5f5, #c1c1c1);
    background: -webkit-gradient(linear, left top, left bottom, from(#f5f5f5), to(#c1c1c1));
    background: -webkit-linear-gradient(#f5f5f5, #c1c1c1);
    background: -o-linear-gradient(#f5f5f5, #c1c1c1);
    background: -ms-linear-gradient(#f5f5f5, #c1c1c1);
    background: linear-gradient(#484747, #2c2c2c);            
 }

nav a:hover, nav a:focus {
    outline: 0;
    color: #fff;
    text-shadow: 0 1px 0 rgba(0,0,0,.2);
    background: #000000;
    background: -moz-linear-gradient(#fac754, #f8ac00);
    background: -webkit-gradient(linear, left top, left bottom, from(#fac754), to(#f8ac00));
    background: -webkit-linear-gradient(#fac754, #f8ac00);
    background: -o-linear-gradient(#f5f5f5, #f5f5f5);
    background: -ms-linear-gradient(#f5f5f5, #ff0000);
    background: linear-gradient(#e20000, #720000);
}

nav a:active {
    -moz-box-shadow: 0 0 5px 5px rgba(0,0,0,.3) inset;
    -webkit-box-shadow: 0 0 5px 5px rgba(0,0,0,.3) inset;
    box-shadow: 0 0 5px 5px rgba(0,0,0,.3) inset;
}

nav li:first-child a {
    border-left: 0;
    -moz-border-radius: 4px 0 0 4px;
    -webkit-border-radius: 4px 0 0 4px;
    border-radius: 4px 0 0 4px;            
}

nav li:last-child a {
    border-right: 0;
    -moz-border-radius: 0 4px 4px 0;
    -webkit-border-radius: 0 4px 4px 0;
    border-radius: 0 4px 4px 0;            
}
}
4

1 回答 1

-1
nav ul {
margin: 80px 0 20px 0;
padding: 0em;
float: left;
list-style: none;
background: #1A1A1A;
background: rgba(26,26,26,.2);
-moz-border-radius: .5em;
-webkit-border-radius: .5em;
border-radius: .5em;    
-moz-box-shadow: 0 1px 0 rgba(255,255,255,.2), 0 2px 1px rgba(0,0,0,.8) inset;
-webkit-box-shadow: 0 1px 0 rgba(26,26,26,.2), 0 2px 1px rgba(0,0,0,.8) inset;
box-shadow: 0 1px 0 rgba(26,26,26,.2), 0 2px 1px rgba(0,0,0,.8) inset; 
}

你的背景是十六进制的两倍,另一个是 rgba,我认为你只需要一个。

于 2013-07-13T12:47:34.950 回答