我试图将图像作为.parent {
width: 100%;
text-align: center;
}
.parent div.child {
display: inline-block;
text-align: left;
width: auto;
}
放在包含旋转木马和jumbotron的整个部分中,当我尝试使用jumbotron作为background-image
部分的顶部和底部的部分有一半的图像
这是html
#eceeef
这是我的SASS文件
<!-- The main section -->
<div class="sectionColor">
<div class="jumbotron jumbotron-fluid jumbotronModified">
<div class="container">
<img class="display-3" src="https://static.wixstatic.com/media/152aef_55aed5c543774335985696d9490acb58~mv2.png/v1/crop/x_12,y_0,w_672,h_209/fill/w_383,h_120,al_c,usm_0.66_1.00_0.01/152aef_55aed5c543774335985696d9490acb58~mv2.png">
<p class="lead">Since 1994</p>
</div>
</div>
<!-- Carousel -->
<div id="mainSection" class="container-fluid">
<div class="row">
<div class="col-md-3"></div>
<div id="carouselExampleControls" class="carousel slide col-md-6" data-ride="carousel">
<div class="carousel-inner" role="listbox">
<div class="carousel-item active">
<img class="d-block img-fluid imgMain" src="assets/tipsolahraga.jpg" alt="First slide">
</div>
<div class="carousel-item">
<img class="d-block img-fluid imgMain" src="assets/board.jpg" alt="Second slide">
</div>
<div class="carousel-item">
<img class="d-block img-fluid imgMain" src="assets/longboard.jpg" alt="Third slide">
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleControls" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExampleControls" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
<div class="col-md-3"></div>
</div>
</div>
</div>
我发现问题,就是jumbotron props类表单引导程序默认情况下将背景图像覆盖为背景颜色.sectionColor
background-image: url(../assets/player.png)
background-repeat: no-repeat
background-size: cover
padding-bottom: 4rem
#mainSection
margin: auto
padding-top: 3rem
.jumbotronModified
text-align: center
.sectionLight
background-color: #ffffff
.coachSection
padding-top: 3rem
我尝试了几种方法来修复,但是我必须更改bootstrap,或者从bootstrap修改类(并且长期效率非常低)或删除整个类
答案 0 :(得分:1)
如何将jumbutron的背景颜色改为透明?
.jumbotronModified
text-align: center
background: transparent;