2
Guys, ask me a question. How to insert a responsive image in the top corner of a section using bootstrap. Ex: this is the site that I am developing renpa.esy.es, however, in the fourth section that has motorcycle packages, I want to put an image right at the top right of the background image.
HTML code - SECTION
<section class="bg-silver" id="four">
<div class="container">
<div class="row">
<div class="col-lg-12 text-center">
</div>
</div>
<div class="row">
<div class="col-md-4 col-sm-6 portfolio-item">
<a href="#portfolioModal1" class="portfolio-link" data-toggle="modal">
<div class="portfolio-hover">
</div>
</a>
<div class="portfolio-caption">
</div>
</div>
<div class="col-md-12 text-center">
<a href="#portfolioModal2" class="portfolio-link" data-toggle="modal">
<div class="portfolio-hover">
</div>
<img src="assets/a4.png" class="img-responsive" alt="">
</a>
<div class="portfolio-caption">
</div>
</div>
<div class="col-md-4 col-sm-6 portfolio-item">
<a href="#galleryModal" class="gallery-box" data-toggle="modal" data-src="./assets/1.png">
<img src="./assets/1.png" class="img-responsive" alt="Image 4">
<div class="gallery-box-caption">
<div class="gallery-box-content">
<div>
<i class="icon-lg ion-ios-search"></i>
</div>
</div>
</div>
</a>
</div>
<div class="col-md-4 col-sm-6 portfolio-item">
<a href="#galleryModal" class="gallery-box" data-toggle="modal" data-src="./assets/2.png">
<img src="./assets/2.png" class="img-responsive" alt="Image 4">
<div class="gallery-box-caption">
<div class="gallery-box-content">
<div>
<i class="icon-lg ion-ios-search"></i>
</div>
</div>
</div>
</a>
</div>
<div class="col-md-4 col-sm-6 portfolio-item">
<a href="#galleryModal" class="gallery-box" data-toggle="modal" data-src="./assets/3.png">
<img src="./assets/3.png" class="img-responsive" alt="Image 4">
<div class="gallery-box-caption">
<div class="gallery-box-content">
<div>
<i class="icon-lg ion-ios-search"></i>
</div>
</div>
</div>
</a>
</div>
<div class="col-md-4 col-sm-6 portfolio-item">
<a href="#portfolioModal6" class="portfolio-link" data-toggle="modal">
<div class="portfolio-hover">
</div>
</a>
<div class="portfolio-caption">
</div>
</div>
</div>
</section>
CSS code - BOOTSTRAP
.bg-silver {
position: relative;
min-height: auto;
text-align: center;
color: #fff;
width: 100%;
background-color: #c9c9c9;
background-image:url(../assets/moto.png);
background-position: center;
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
-o-background-size: cover;
height:auto !important;
}
.content-section-d {
min-height: auto;
width: 100%;
background-repeat: no-repeat;
background-position: center;
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
-o-background-size: cover;
padding: 100px 15px;
height:auto !important;
}
It worked. Thank you very much. Perfect
– Renan Bessa
But there’s another question. Now I want to put this same image in the same position on the left side in the "car package" section, but when inserting, the image goes to the top of the page, that is, goes to the first section. How to do?
– Renan Bessa
I recommend opening another question, the concept here is a simple question by topic. if this is answered we close it and open a new, I will be happy to help;
– Dorathoto
but in theory just exchange the right for left: 0px
– Dorathoto
Don’t forget that the parent element needs to have
position:relative
so that the child withposition:absolute
stay in the desired position.– Marta