一种解决方案是使用background:rgba(255,255,255,0.7);并为#navbar-logo提供更高的z-index:
.navbar {
font-family: 'Roboto', arial;
position: fixed;
}
.navbar #navbar-back {
background: rgba(255, 255, 255, 0.7);
border-bottom: solid;
border-bottom-width: 1px;
border-bottom-color: #A4A4A4;
width: 100%;
height: 55px;
}
.navbar #navbar-logo {
font-size: 35px;
color: black;
opacity: 1;
z-index: 2;
}
检查这里的区别:
.navbar {
font-family: 'Roboto', arial;
position: fixed;
}
.navbar #navbar-back {
background: rgba(255, 255, 255, 0.7);
border-bottom: solid;
border-bottom-width: 1px;
border-bottom-color: #A4A4A4;
width: 100%;
height: 55px;
}
.navbar #navbar-logo {
font-size: 35px;
color: black;
opacity: 1;
z-index: 2;
}