简体   繁体   English

使用引导程序在超大屏幕上调整附加图片的大小

[英]Resize add ons picture on jumbotron using bootstrap

Can somebody help me, I wanna build my portfolio web, but in this case, I wanna show my photo on jumbotron using bootstrap, you can see my sample below: https://i.stack.imgur.com/W8xFE.jpg有人可以帮助我,我想建立我的投资组合网站,但在这种情况下,我想使用引导程序在 jumbotron 上显示我的照片,您可以在下面看到我的示例: https ://i.stack.imgur.com/W8xFE.jpg

can I resize the photo, if this can, how?我可以调整照片大小吗,如果可以,如何调整? here my code这是我的代码

 <div id="carouselExampleSlidesOnly" class="carousel slide" data-ride="carousel"> <div class="carousel-inner"> <div class="carousel-item active"> <img src="img/01.jpg" class="d-block w-100" alt="..."> <div class="carousel-caption d-none d-md-block"> <h1 class="display-4">About Me</h1> <img src="img/user.png" id="profile"> <h2>TEXT HERE</h2> </div> </div> </div>

 /*jumbotron*/ .jumbotron{ /*background-image: url(../img/01.jpg);*/ background-size: cover; text-align: center; height: 760px; color: #fff; margin-top: -20px; } .display-4{ margin-top: 150px; } /*slider*/ .carousel-item img{ background-size: cover; display: flex; height: 100vh; } .carousel-item h1{ margin-top: -550px; text-align: center; font-size: 40px ; font-weight: bold; } .carousel-item p{ /*margin-top: -550px;*/ text-align: center; font-size: 36px ; font-weight: unset; }
 <div id="carouselExampleSlidesOnly" class="carousel slide" data-ride="carousel"> <div class="carousel-inner"> <div class="carousel-item active"> <img src="img/01.jpg" class="d-block w-100" alt="..."> <div class="carousel-caption d-none d-md-block"> <h1 class="display-4">About Me</h1> <img src="img/user.png" id="profile"> <h2>TEXT HERE</h2> </div> </div> </div>

Because of this part of code, all the images inside carousel-item will have 100vh height:由于这部分代码,carousel-item 中的所有图像都将具有 100vh 高度:

.carousel-item img{
    background-size: cover;
    display: flex;
    height: 100vh;
}

so you should just select the one you want.所以你应该只选择你想要的。 you can write this styles:你可以写这种风格:

.carousel-item > img{
    background-size: cover;
    display: flex;
    height: 100vh;
}



 .carousel-caption img{
  width: 200px; /* whatever you want*/
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM