Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/71.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
Html 使引导转盘背景透明_Html_Css_Bootstrap 4_Carousel - Fatal编程技术网

Html 使引导转盘背景透明

Html 使引导转盘背景透明,html,css,bootstrap-4,carousel,Html,Css,Bootstrap 4,Carousel,我是CSS的新手,我想在彩色div的顶部制作一个透明的旋转木马,我如何才能做到这一点 以下是我目前的结果: 这是我的htmlcode: <div class="second-phase"> <!-- Tab for Carousel--> <div id="products-page-carousel"></div> <!--Carousel View--> <d

我是CSS的新手,我想在彩色div的顶部制作一个透明的旋转木马,我如何才能做到这一点

以下是我目前的结果:

这是我的
html
code:

<div class="second-phase">
        <!-- Tab for Carousel-->
        <div id="products-page-carousel"></div>

        <!--Carousel View-->
        <div id="carousel" class="carousel slide"  data-ride="carousel">

            <!-- The slideshow -->
            <div class="carousel-inner" >
                <div class="carousel-item active" id="my-carousel-bg" >
                    <center>
                        <img src="/media/g01hgi0m/branded-basin.png" alt="Los Angeles" width="30%" height="30%">
                    </center>
                </div>
                <div class="carousel-item" id="my-carousel-bg">
                    <center>
                        <img src="/media/waqd3xdw/branded-milk-crate.png" alt="Chicago" width="10%" height="10%">
                    </center>
                </div>
                <div class="carousel-item" id="my-carousel-bg">
                    <center>
                        <img src="/media/g01hgi0m/branded-basin.png" alt="New York" width="30%" height="30%">
                    </center>
                </div>
            </div>

            <!-- Left and right controls -->
            <a class="carousel-control-prev" href="#carousel" data-slide="prev">
                <img src="/media/aqrnoaxe/asset-1.png" width="17%"/>
            </a>
            <a class="carousel-control-next" href="#carousel" data-slide="next">
                <img src="/media/xqwj1jpx/asset-3.png" width="17%"/>
            </a>
        </div>    
    </div>
我的输出应该是这样的:


一个页面上不能有多个id标签。它们在整个文档中应该是唯一的。尝试从一个id更改为一个类,看看这是否解决了问题。

您在多个
div
上使用相同的
id=”“
,对于多个
div
使用
class
,那么
是白色背景的div吗?@RamondeVries,仅
id=“my carousel bg”
是透明背景的,我想知道白色背景是从哪里来的我知道你把
背景色:透明
应用到了
div
,但它真的是透明的还是css的穿孔不起作用?尝试查看浏览器的inspect元素,打开和关闭一些div,查看白色背景何时消失当我在浏览器中检查时,我将此div更改为不同的颜色,它会更改背景,但当我使用透明的颜色代码时,当我尝试复制问题时,它不起作用,没有白色背景,
background transparent
对我有效,你确定没有其他css仍然否决,或者其他div导致白色背景,因此
background:transparent
有效,但另一个白色div隐藏在它后面吗
.second-phase{
    margin-top: -170px;
    height: 700px;
}
#my-carousel-bg{
    background-color: transparent;
    opacity: 2;
}