CSS3交替表行不透明度会影响文本和背景

Lit*_*ait 1 html css css3

我想提出一些CSS来匹配我在iPhone/Android应用程序中的风格.我有不透明的交替行颜色,所以我的自定义页面背景渗透.但是,我遇到的问题是我不希望表格单元格中的文本也是不透明的.我希望文本的不透明度为1.0,背景为不透明度= 0.12.请看这里现在的样子.

CSS下面:

html {
   -webkit-background-size: cover;
   -moz-background-size: cover;
   -o-background-size: cover;
   background-size: cover;
   height: 100%;
   background-image: url(../images/mmbg@2x.png);
}
table {
   background-color: transparent;
   margin-left: 0px;
   margin-right: 0px;
   margin-top: 10;
   height: 100%;
   width: 100%;
   border: 0;
   border-collapse: collapse;
}
tr {
   text-align: center;
   padding: 0;
}
td {
   font-family: verdana;
   color: #ffffff;
   text-shadow: 1px 1px 1px #77777777, 2px 2px 7px #ff0000;
   padding: 0;
}
tr:nth-child(odd)    { background-color:#003366; opacity:.12; filter:alpha(12); }
tr:nth-child(even)      { background-color:#6a737d; opacity:.12; filter:alpha(12); }
Run Code Online (Sandbox Code Playgroud)

Tet*_*axa 7

您可以使用rgba颜色作为背景.opacity将影响子元素,并没有太多的事情要做.