問題:我輸入不透明度後:0.5(或其他)它適用於標題中的所有對象。我該如何解決它?在標題h1中輸入不透明度:1,h2不起作用。如何僅在CSS/HTML中的一個項目上製作OPACITY
這裏是的jsfiddle鏈接:http://jsfiddle.net/unyfmf3d/
這裏是CSS代碼:
body {
background: #E6E6E6;
color: black;
}
.header {
opacity:0.2;
margin:0px auto;
width:700px;
height:150px;
background: white;
}
#header h1 {
opacity:1;
font-family: times, Times New Roman, times-roman, georgia, serif;
color: #444;
margin:0px;
padding: 0px 0px 6px 0px;
font-size: 51px;
line-height:20px;
letter-spacing:-2px;
font-weight:bold;
}
#header h2 {
opacity:1;
font-family: Gill Sans, Verdana;
font-size: 11px;
line-height: 14px;
text-transform: uppercase;
letter-spacing:2px;
font-weight: bold;
}
工作正常。非常感謝你。 – semkius
還有一個問題。如果我想要做圖像背景,它會看起來像'background-image(url ....)'然後'background:rgba(255,255,255,0.2);'圖像是否變得透明? – semkius