rgba設置的背景透明沒用啊
本來跟著老師的做的,設置了background-color: rgba(255,255,255,0.1);結果就成上邊的樣子了,求大神指導啊,啊啊啊啊
.graySection?.articlPreview?.imgSection { ????width:?45%; } .imgSection?img { ????width:?100%; } .graySection?.articlPreview?.textSection { ????width:?55%; ????position:?relative; ????top:?68px; ????left:?60px; }/*文字沒有width:?60%;這個就沒有浮動*/ .graySection?.articlPreview { ????background:?#252f34; ????color:?#fff; } /*articlPreview下的第一級div(子元素)*/ .articlPreview?>?div { ????float:?left; ????font-size:?0;/*兩個articlPreview之間會有間隙,是字體大小不一樣的原因 所有要充值字體大小*/ } /*清除浮動*/ .articlPreview:after { ????content:?""; ????display:?block; ????clear:?both; } .textSection?h2 { ????font-size:?20px; ????margin-bottom:?20px; } .textSection?p { ????font-size:?16px; ????letter-spacing:?1px; } .textSection?.sub-heading { ????font-size:?17px; ????/*margin-top:?0;*/ } .textSection?>?* { ????max-width:?90%; } .articlPreview:nth-child(odd) { ????background-color:?rgba(255,255,255,0.1); }
2017-03-10
.article-preview:nth-child(2n+1) {
????background-color: rgba(255, 255, 255, 0.1);
}代碼換成這個試下,實在不行用firebug看下怎么會出不來,你下面的背景色都有的。