Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 旋转木马图像上的RGBA覆盖_Css_Twitter Bootstrap 3 - Fatal编程技术网

Css 旋转木马图像上的RGBA覆盖

Css 旋转木马图像上的RGBA覆盖,css,twitter-bootstrap-3,Css,Twitter Bootstrap 3,我正试图在我的引导旋转木马中的幻灯片上覆盖RGBA。我以为这很简单,但显然不是 我曾尝试使用:before选择器添加背景,但没有成功 .carousel-inner>.item>a>img, .carousel-inner>.item>img, .img-responsive, .thumbnail a>img, .thumbnail>img:before { content:'\A'; width:100%; height:100%;

我正试图在我的引导旋转木马中的幻灯片上覆盖RGBA。我以为这很简单,但显然不是

我曾尝试使用:before选择器添加背景,但没有成功

.carousel-inner>.item>a>img, .carousel-inner>.item>img, .img-responsive, .thumbnail a>img, .thumbnail>img:before {
    content:'\A';
    width:100%; height:100%;
    top:0; left:0;
    background:rgba(0,0,0,0.6);
}

我怀疑你在找这样的东西:

.carousel-inner>.item {
    position: relative;
}

.carousel-inner>.item:before {
    content:'';
    position: absolute;
    width:100%; 
    height:100%;
    top:0; 
    left:0;
    background:rgba(0,0,0,0.6);
}

您需要添加更多详细信息,您的html是什么样子的?你能准备一段吗?