我寫了一些HTML和CSS代碼。這裏是我的HTML代碼:ul工作不透明,但按鈕有不透明度,我不想
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale:1.0">
<link type="text/css" rel="stylesheet" href="stylesheet.css">
</head>
<body>
<a href=""><img src="../_images/imgres.jpg" id="Sushi" width="50" height="50" alt="Sushi" title="Sushi"></a>
<nav role="navigation">
<ul>
<li><a href="" title="Home" id="home">Home</a></li>
<li><a href="" title="About" id="about">About</a></li>
<li><a href="" title="Contact Us" id="contactus">Contact Us</a></li>
</ul>
</nav>
</body>
</html>
這裏是我的CSS代碼:
/*CSS Reset*/
html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
img#sushi {
position: absolute;
z-index: 1;
top: 6;
left: 6;
}
nav li {
list-style-type: none;
display: inline-block;
padding: 1em;
background-color: aqua;
}
nav a {
text-decoration: none;
color: white;
background-color: black;
padding: .7em;
font-size: 1.2em;
}
nav ul {
background-color: aqua;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 4em;
opacity: .5;
}
nav li a#home {
position: absolute;
top: 6;
right: 10;
opacity: 1;
}
nav li a#contactus {
position: absolute;
top: 6;
right: 110;
opacity: 1;
}
nav li a#about {
position: absolute;
top: 6;
right: 250;
opacity: 1;
}
我碰到的一個問題。我將UL的不透明度設置爲.5,將按鈕設置爲1.問題是,按鈕仍然是.5。請幫忙!