Carousel indicators & control are not responding to mouse click - html

I have added two carousel slider on my webpage. main header carousel slider is working properly but second one having problems
a. it doesn't auto slide when website load. (but sometimes it does slide)
b. Indicators and Controls are not responding when clicked.
I already checked the following
a. Id, data-target and href
b. z-index
c. Libraries
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="https://unpkg.com/popper.js#1.15.0/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
**Check CodePen here: **
https://codepen.io/abdulrehman-siddiqi/pen/XWrMgqq
**Working Site: **
http://mirchisamosa.tk

This is a basic bootstrap carousel changed to include 4 images per slide... you will see that I made minor changes to get the multiple images to work...
Working snippet below:
.work-item.active {
display: flex;
margin-left: 0;
}
.carousel-item {
height: 150px;
}
.work-img {
display: inline-block;
max-width: 24% !important;
padding: 10px 10px;
}
.divContollers ul,
.divContollers a {
border: 2px solid red;
height: 40px;
top: 100%;
color: #000;
background: black;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<div class='container-fluid'>
<div class='row'>
<div id="demo" class="carousel slide" data-ride="carousel">
<!-- The slideshow -->
<div class="carousel-inner">
<div class="carousel-item work-item active">
<img src="https://www.w3schools.com/bootstrap4/la.jpg" class='img-fluid' alt="Los Angeles" width="1100" height="500">
</div>
<div class="carousel-item work-item row ">
<div class="work-img col-4 col-sm-4 col-md-3 col-lg-3"><img src="https://picsum.photos/id/952/536/354.jpg" class="img-fluid " alt="img5"></div>
<div class="work-img col-4 col-sm-4 col-md-3 col-lg-3"><img src="https://picsum.photos/id/952/536/354.jpg" class="img-fluid " alt="img6"></div>
<div class="work-img col-4 col-sm-4 col-md-3 col-lg-3"><img src="https://picsum.photos/id/952/536/354.jpg" class="img-fluid " alt="img7"></div>
<div class="work-img col-4 col-sm-4 col-md-3 col-lg-3"><img src="https://picsum.photos/id/952/536/354.jpg" class="img-fluid " alt="img8"></div>
</div>
<div class="carousel-item work-item row ">
<div class="work-img col-sm-4 col-md-3 col-lg-3"><img src="https://picsum.photos/536/354.jpg" class="img-fluid" alt="img9"></div>
<div class="work-img col-sm-4 col-md-3 col-lg-3"><img src="https://picsum.photos/536/354.jpg" class="img-fluid" alt="img10"></div>
<div class="work-img col-sm-4 col-md-3 col-lg-3"><img src="https://picsum.photos/536/354.jpg" class="img-fluid" alt="img11"></div>
<div class="work-img col-sm-4 col-md-3 col-lg-3"><img src="https://picsum.photos/536/354.jpg" class="img-fluid" alt="img12"></div>
</div>
</div>
<div class='divContollers'>
<ul class="carousel-indicators">
<li data-target="#demo" data-slide-to="0" class="active"></li>
<li data-target="#demo" data-slide-to="1"></li>
<li data-target="#demo" data-slide-to="2"></li>
<!--
-->
</ul>
<!-- Left and right controls -->
<a class="carousel-control-prev" href="#demo" data-slide="prev">
<span class="carousel-control-prev-icon"></span>
</a>
<a class="carousel-control-next" href="#demo" data-slide="next">
<span class="carousel-control-next-icon"></span>
</a>
</div>
</div>
</div>
</div>

Related

Bootstrap 4 Carousel with solid color in background and Image on right and text on left

Pardon me if I am asking something silly, but I have a requirement to create a full page slider with solid color as background and some text on left side and an image on right. Something like Google's Gmail Page.
Currently the result I want is
I have used Bootstrap 4's Carousel
I have modified it slightly and made its background grey as its in Google's image. Now I want the text to be left aligned and have a responsive auto resizeable image on the right (Or even if I can have an image adjusted on the top of the text only) which is also responsive when viewed on mobile. Something like
.
I am using this fiddle and I have modified the code as
<div class="carousel-item" style="background-color: #eff0f1">
<div class="carousel-caption d-none d-md-block">
<h2 class="display-4">First Slide</h2>
<p class="lead">This is a description for the first slide.</p>
</div>
</div>
<style>
.carousel-item {
background-color: #eeeeee; /*Solid grey background*/
}
.carousel-caption {
color: black;
}
</style>
Remove d-none class from carousel-caption and try this way :
.carousel-item {
height: 100vh;
min-height: 350px;
background: no-repeat center center scroll;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
.text_part{
display: none;
}
#media (max-width: 575px){
.text_part{
display: block;
}
.left_part{
display: none;
}
}
<section class="text_part">
<div class="text">
<h2 >your text</h2>
</div>
</section>
<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="2"></li>
</ol>
<div class="carousel-inner" role="listbox">
<!-- Slide One - Set the background image for this slide in the line below -->
<div class="carousel-item active" style="background-color: gray">
<div class="carousel-caption d-md-block">
<div class="row">
<div class="col-md-6 left_part">
your text
</div>
<div class="col-md-6 col-sm-12">
img
</div>
</div>
</div>
</div>
<!-- Slide Two - Set the background image for this slide in the line below -->
<div class="carousel-item" style="background-color: pink">
<div class="carousel-caption d-md-block">
<div class="row">
<div class="col-md-6 left_part">
your text
</div>
<div class="col-md-6 col-sm-12">
img
</div>
</div>
</div>
</div>
<!-- Slide Three - Set the background image for this slide in the line below -->
<div class="carousel-item" style="background-color: green">
<div class="carousel-caption d-md-block">
<div class="row">
<div class="col-md-6 left_part">
your text
</div>
<div class="col-md-6 col-sm-12">
img
</div>
</div>
</div>
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleIndicators" 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="#carouselExampleIndicators" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>

Bootstrap Carousel li item active class not working

I took the code of the bootstrap 4 carousel and then split it into 2 cols, I did it because I need the carousel indicators to be somewhere else and not inside the carousel (as default).
The problem here is that the carousel is working well (at least the part of changing the image) it's just the "active" class that doesn't change to any other li item.
HTML
<div class="row mx-0">
<div class="col-lg-3 col-md-3 col-sm-12 px-5">
<h2 class="primary-color text-center text-uppercase" id="nombre-caso">Name Image</h2>
<h3 id="descripcion-caso" class="primary-color text-center">Description Image</h3>
</div>
<div class="col-lg-1 col-md-1 col-sm-12">
<ol class="list-unstyled d-lg-block d-md-block d-flex" id="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active" style="margin-top:0;">
<i class="fas fa-circle"></i>
</li>
<li data-target="#myCarousel" data-slide-to="1">
<i class="fas fa-circle"></i>
</li>
<li data-target="#myCarousel" data-slide-to="2">
<i class="fas fa-circle"></i>
</li>
<li data-target="#myCarousel" data-slide-to="3">
<i class="fas fa-circle"></i>
</li>
<li data-target="#myCarousel" data-slide-to="4">
<i class="fas fa-circle"></i>
</li>
<li data-target="#myCarousel" data-slide-to="5">
<i class="fas fa-circle"></i>
</li>
<li data-target="#myCarousel" data-slide-to="6">
<i class="fas fa-circle"></i>
</li>
<li data-target="#myCarousel" data-slide-to="7">
<i class="fas fa-circle"></i>
</li>
<li data-target="#myCarousel" data-slide-to="8">
<i class="fas fa-circle"></i>
</li>
<li data-target="#myCarousel" data-slide-to="9">
<i class="fas fa-circle"></i>
</li>
</ol>
</div>
<div class="col-lg-8 col-md-8 col-sm-12 px-0">
<div class="slide-wrapper">
<div class="container" id="carousel-container">
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="carousel-item active">
<div class="fill" style="background-image: url(img/casos-exito/cob_galeria_01_harley.jpg)"></div>
</div>
<div class="carousel-item">
<div class="fill" style="background-image: url(img/casos-exito/cob_galeria_02_freightliner.jpg)"></div>
</div>
<div class="carousel-item">
<div class="fill" style="background-image: url(img/casos-exito/cob_galeria_03_loarca.jpg)"></div>
</div>
<div class="carousel-item">
<div class="fill" style="background-image: url(img/casos-exito/cob_galeria_04_automotriz_bajio.jpg)"></div>
</div>
<div class="carousel-item">
<div class="fill" style="background-image: url(img/casos-exito/cob_galeria_05_almacenes.jpg)"></div>
</div>
<div class="carousel-item">
<div class="fill" style="background-image: url(img/casos-exito/cob_galeria_06_bodegas_industriales.jpg)"></div>
</div>
<div class="carousel-item">
<div class="fill" style="background-image: url(img/casos-exito/cob_galeria_07_residencial_queretaro.jpg)"></div>
</div>
<div class="carousel-item">
<div class="fill" style="background-image: url(img/casos-exito/cob_galeria_08_secundaria_ignacio_altamirano.jpg)"></div>
</div>
<div class="carousel-item">
<div class="fill" style="background-image: url(img/casos-exito/cob_galeria_09_oficinas_icsi.jpg)"></div>
</div>
<div class="carousel-item">
<div class="fill" style="background-image: url(img/casos-exito/cob_galeria_10_casa_zibata.jpg)"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
CSS
.carousel-inner,.carousel,.carousel-item,.container#carousel-container,.fill {
height:100%;
min-height:700px;
width:100%;
background-position:center center;
background-size:cover;
}
.slide-wrapper{display:inline;}
.slide-wrapper .container{padding:0;}
/*------------------------------ vertical bootstrap slider----------------------------*/
.carousel-inner> .carousel-item.carousel-item-next ,
.carousel-inner > .carousel-item.active.carousel-item-right{
transform: translate3d(0, 100%, 0); -webkit-transform: translate3d(0, 100%, 0); -ms-transform: translate3d(0, 100%, 0); -moz-transform: translate3d(0, 100%, 0); -o-transform: translate3d(0, 100%, 0); top: 0;
}
.carousel-inner > .carousel-item.carousel-item-prev ,
.carousel-inner > .carousel-item.active.carousel-item-left{
transform: translate3d(0,-100%, 0); -webkit-transform: translate3d(0,-100%, 0); -moz-transform: translate3d(0,-100%, 0);-ms-transform: translate3d(0,-100%, 0); -o-transform: translate3d(0,-100%, 0); top: 0;
}
.carousel-inner > .carousel-item.next.carousel-item-left ,
.carousel-inner > .carousel-item.carousel-item-prev.carousel-item-right ,
.carousel-inner > .carousel-item.active{
transform:translate3d(0,0,0); -webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);; -moz-transform:translate3d(0,0,0); -o-transform:translate3d(0,0,0); top:0;
}
/*------------------------------- vertical carousel indicators ------------------------------*/
#carousel-indicators li{
margin: 35px 0;
color: gray;
}
#carousel-indicators li.active i{
color: var(--primaryColor);
}
I just want to change the color of the active dot to show some good user experience on my page.
This could be easily achieved with minimal css; the key for you will be to have both the sections ("section of indicators" & "section of images") inside the carousel div (this is the div which has the id='myCarousel'; This way you'll get the default functionality including the auto slide where you see the 'active' class being applied also.
working snippet below:
/* Make the image fully responsive */
.carousel-inner img {
width: 100%;
height: 100%;
}
.carousel-indicators {
display: block !important;
height: 90% !important;
}
.carousel-indicators li {
background-color: red !important;
width: 10px !important;
height: 10px !important;
margin: 40% !important;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<div class='container-fluid'>
<h2>Demo Carousel</h2>
<div id="demo" class="carousel slide" data-ride="carousel">
<div class='row'>
<div class='col-lg-1 col-md-1 col-sm-1 col-1'>
<!-- Indicators -->
<ul class="carousel-indicators">
<li data-target="#demo" data-slide-to="0" class="active"></li>
<li data-target="#demo" data-slide-to="1"></li>
<li data-target="#demo" data-slide-to="2"></li>
<li data-target="#demo" data-slide-to="3"></li>
</ul>
</div>
<div class='col-lg-11 col-md-11 col-sm-11 col-11'>
<!-- The slideshow -->
<div class="carousel-inner">
<div class="carousel-item active">
<img src="https://www.w3schools.com/bootstrap4/la.jpg" alt="Los Angeles" width="1100" height="500">
</div>
<div class="carousel-item">
<img src="https://www.w3schools.com/bootstrap4/chicago.jpg" alt="Chicago" width="1100" height="500">
</div>
<div class="carousel-item">
<img src="https://www.w3schools.com/bootstrap4/ny.jpg" alt="New York" width="1100" height="500">
</div>
<div class="carousel-item">
<img src="https://www.akberiqbal.com/Jumbo.jpg" alt="Akber Iqbal" width="1100" height="500">
</div>
</div>
</div>
</div>
</div>
</div>
NOTE: I had to put !important against each property here on stack overflow code snippet because it loads the custom CSS before the bootstrap.css - in your actual code, place the <style>...</style> block after you load bootstrap.css and you wouldn't have to write !important;

Slide on Bootstrap 3 Carousel error

I'm working with a Bootstrap 3 carousel. Here is what I have done far, I want it to look similar to this.
Why does the slide preview from column 2 anytime I click the arrows? Is there a way to hide the preview from showing up when clicking next/previous
Anytime I click past two slides, it errors out and doesn't go back to the first slide.
<style type="text/css">
/* #information, #video {
width: 50%; //CSS styling for table tags.
} */
.linebreak {
display: none;
}
.image {
float: left!important;
}
.carousel slide {
width: 400px;
}
.text {
width: 45%!important;
float: right!important;
right: 14px!important;
/* top: 10px!important; */
margin-right: 35px!important;
/* margin-top: 20px!important; */
}
.carousel-inner {
overflow: visible;
}
.carousel img {
border-radius: 0px;
width: 140px;
margin-right: 10px;
margin-left: 80px;
}
.carousel-control active {
position: fixed;
}
.carousel {
margin-top: 40px;
}
.firstcolumn {
width: 1000px;
}
/*.video-container {
/*position:relative;
padding-bottom:315px;
padding-top:10px; /* width: 100% ;* max-width: 500px; padding-right:0px;
/*max-height:530px; overflow: auto;
border: none;
}
.video-container img {
position:absolute;
top:0;
left:0;
width:100%;
max-width: 500px;
max-height:530px;
height:100%;
margin: 0px;*/
/*}*/
</style>
<div class="firstcolumn">
<div class="row">
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6"> <!-- DIV 1 BEGIN -->
<div id="myCarousel" class="carousel slide" data-ride="carousel" data-interval="false">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
</ol>
<div class="carousel-inner">
<div class="item active">
<img class="image" src="https://www.evantage-technology.com/wp-content/uploads/2015/04/product_office365.jpg" alt="Los Angeles">
<div class="text">Office 365 is the brand name Microsoft uses for a group of subscriptions that provide productivity software and related services.</div>
</div>
<div class="item">
<img class="image" src="http://office365.ecolearning.eu/img/office_icos/delve-logo.png" alt="Chicago">
<div class="text">Microsoft Office Delve is a data visualization and discovery tool that incorporates elements of social networking and machine learning with the search capability of the Microsoft Office 365 suite.</div>
</div>
<!-- <div class="item">
<img src="ny.jpg" alt="New York">
</div>
</div> -->
<!-- Left and right controls -->
<a class="left carousel-control" href="#myCarousel" data-slide="prev" style="margin-top: 50px">
<span class="glyphicon glyphicon-chevron-left"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#myCarousel" data-slide="next" style="margin-top: 50px">
<span class="glyphicon glyphicon-chevron-right"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>
</div> <!-- DIV 1 END -->
<div class="secondcolumn">
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
<center><h3>WHAT DO YOU WANT TO DO?</h3></center>
<br/>
<div class="row">
<div class="col-sm-6" align="center">.col-sm-3</div>
<div class="col-sm-6" align="center">.col-sm-6</div>
</div>
<div class="row">
<div class="col-sm-6" align="center">.col-sm-3</div>
<div class="col-sm-6" align="center">.col-sm-6</div>
</div>
</div>
</div>
</div>
</div>
If you make use of the Bootstrap Grid inside your Carousel component you can avoid using any customized CSS. You just need to structure your HTML accordingly:
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 col-md-6">
<div id="myCarousel" class="carousel slide" data-ride="carousel" data-interval="false">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
</ol>
<div class="carousel-inner">
<div class="item active">
<div class="row">
<div class="col-xs-4"><img class="img-responsive" src="https://www.evantage-technology.com/wp-content/uploads/2015/04/product_office365.jpg" alt="Los Angeles"></div>
<div class="col-xs-8">Office 365 is the brand name Microsoft uses for a group of subscriptions that provide productivity software and related services.</div>
</div>
</div>
<div class="item">
<div class="row">
<div class="col-xs-2"><img class="img-responsive" src="http://office365.ecolearning.eu/img/office_icos/delve-logo.png" alt="Chicago"></div>
<div class="col-xs-10">Microsoft Office Delve is a data visualization and discovery tool that incorporates elements of social networking and machine learning with the search capability of the Microsoft Office 365 suite.</div>
</div>
</div>
</div>
<!-- Left and right controls -->
<a class="left carousel-control" href="#myCarousel" data-slide="prev"><span class="glyphicon glyphicon-chevron-left"></span><span class="sr-only">Previous</span></a>
<a class="right carousel-control" href="#myCarousel" data-slide="next"><span class="glyphicon glyphicon-chevron-right"></span><span class="sr-only">Next</span></a>
</div>
</div>
<div class="col-xs-12 col-md-6">
<h3 class="text-center">WHAT DO YOU WANT TO DO?</h3>
<div class="row">
<div class="col-sm-6 text-center">A</div>
<div class="col-sm-6 text-center">B</div>
</div>
<div class="row">
<div class="col-sm-6 text-center">C</div>
<div class="col-sm-6 text-center">D</div>
</div>
</div>
</div>
</div>
You may need to expand the snippet to view its responsive nature. I would also point out that you were using elements like <center> which were depreciated, or attributes like align="center" on your <div> elements. You should use CSS for this sort of positioning, which with respect to Bootstrap would involve applying the text-center class to the element whose contents you wish to be centered.

CSS Overlay on a circle image

I have a problem with CSS overlay. I'm making a website for a dog breeder and I want to make a carousel with male and female dogs. So my idea is to have 3 circular shaped images of male dogs on one slide of a carousel and 3 of female dogs on another. All of my images are 1000x1000 so they give a perfect circle on border-radius 50%.
On the overlay of the image there should be like 80% transparent background with dog's name and pedigree over the image. But my code does not work as it should so please help :)
Here's a part of my HTML for images:
<article>
<h2>Naši psi</h2>
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<div class="carousel-inner">
<div class="item active kontejner">
<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
<img class="slika_psa" src="slika_pas.jpg"/>
<div class="info">
<h3>Sass Crveni Mayestoso</h3>
</div>
</div>
<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
<img class="slika_psa" src="slika_pas3.jpg"/>
</div>
<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
<img class="slika_psa" src="slika_pas2.jpg"/>
</div>
<h3 class="spol">Mužjaci</h3>
</div>
<div class="item kontejner">
<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
<img class="slika_psa" src="slika_pas.jpg"/>
</div>
<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
<img class="slika_psa" src="slika_pas3.jpg"/>
</div>
<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
<img class="slika_psa" src="slika_pas2.jpg"/>
</div>
<h3>Mužjaci</h3>
</div>
<br><br>
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
</ol>
<!-- Left and right controls -->
<a class="left carousel-control" href="#myCarousel" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#myCarousel" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
<span class="sr-only">Next</span>
</a>
</div>
</article>
And part of CSS:
.kontejner {width: 90%;
margin: 25px auto;}
.slika_psa {
width: 80%;
border: 16px solid #fff;
border-radius: 50%;
background-color: #1c1c1c;
overflow: hidden;
}
.info {position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
height: 100%;
width: 100%;
visibility: hidden;
transition: .5s ease;
background-color: #008CBA;
}
.slika_psa:hover .info {visibility: visible;}
.carousel-inner {height: 100%;}
article {display: table;
width: 100%;
height: 100vh;
margin-top: 50px;
background-image: url('background..jpg');}
I can't figure it out how to make perfect circular overlay...Any help appreciated.

Bootstrap carousel responsive img

I want to have the img in the carousel responsive. The height should be 100vh but the width needs to be as wide as it goes, depending on how big the img is. The overflowing part should be hidden. Now, when the screen gets smaller, the img is resized not to scale. Here's some screen shots
This is fine at full width, desktop version
This is about the witdh of tablets, but there are white space at the bottom which i dont want.
This is the phone version, resized but not to scale. It should also takes up the whole window, but the overflowing width can be hidden.
This is what I have for css:
.carousel,
.carousel-inner {
height: 100vh;
}
.carousel img {
position: absolute;
top: 0;
left: 0;
min-width: 100vw;
height: 100vh;
max-width: none;
}
<div class="carousel-inner" role="listbox">
<div class="item active">
<img class="img-responsive" src="photos/JO2_2978.JPG" alt="xmas_orchestra">
</div>
<div class="item">
<img src="photos/JO2_2875.JPG" alt="...">
</div>
<div class="item">
<img src="photos/IMG_1824.JPG" alt="...">
</div>
<div class="item">
<img src="photos/JO2_2955.JPG" alt="...">
</div>
<div class="item">
<img src="photos/IMG_3913.JPG" alt="...">
</div>
<div class="item">
<img src="photos/JO2_2957.JPG" alt="...">
</div>
</div> <!-- CAROUSEL-INNER -->
There is a better and a very simple way to do this.
Keep all your carousel code within the bootstrap column within a row(Grid system)
And give some class name like .carousel-column in my example and then do two things.
1.Set some height and width as per your wish in your custom css file.
2.And set img-responsive in your code in the mail HTML Page for carousel items.
It worked for me, hope it will work for all.
HTML CODE:
<!-- Carousel to highlight main services-->
<div class="row">
<div class="col-md-9 carousel-column">
<div id="myCarousel" class="carousel slide">
<!-- 1.Carousel Indicators-->
<ol class="carousel-indicators">
<li data-target="#myCarousel" class="active" data-
slideto="0</li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
</ol>
<!-- 2.carousel Items (Picture plus data)-->
<div class="carousel-inner">
<div class="item active">
<img src="images/book2.jpg" class="img-responsive img-cus" >
<div class="container">
<div class="carousel-caption">
<h1>Web Development</h1>
<h3>Let's begin development.It really is about who you are and what you can do</h3>
<p><a class="btn btn-primary btn-large" href="signup.html">Sign Up</a></p>
</div>
</div>
</div>
<div class="item">
<img src="images/book.jpg" class="img-responsive img-cus">
<div class="container">
<div class="carousel-caption">
<h1>Twitter Bootstrap</h1>
<h3>A HTML,CSS,Javascript library for responsive
mobile first web development</h3>
<p><a class="btn btn-primary btn-large"
href="signup.html">Sign Up</a></p>
</div>
</div>
</div>
<div class="item">
<img src="images/coffee.jpg" class="img-responsive img-cus"
>
<div class="container">
<div class="carousel-caption">
<h1>Java Tutorials</h1>
<h3>A powerful secure server side object oriented
programming language</h3>
<p><a class="btn btn-primary btn-large"
href="signup.html">Sign Up</a></p>
</div>
</div>
</div>
</div>
<!-- Now We will create the carousel controls-->
<a href="#myCarousel" class="left carousel-control" data-
slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
</a>
<a href="#myCarousel" class="right carousel-control" data-
slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
</a>
</div>
</div>
</div>
Now do this in CSS file
CSS Styling:
.carousel-column{
height:500px;
width:900px;
margin:0 auto;
}
Try this:
Check Demo here
HTML:
<div class="carousel slide" data-ride="carousel">
<div class="carousel-inner" role="listbox">
<div class="item active" style="background-image:url(http://dentistry.utah.edu/images/slider-banner/roy-hume.jpg); ">
</div>
<div class="item" style="background-image: url(http://dentistry.utah.edu/images/slider-banner/school-dentistry-students.jpg);">
</div>
</div>
<!-- CAROUSEL-INNER -->
</div>
CSS:
.carousel,
.carousel-inner {
height: 100vh;
}
.item {
border: 1px solid grey;
max-height: 100vh;
min-height: 100vh;
max-width: 100vw;
background-size: cover;
background-position: center center;
background-repeat: no-repeat;
}
if you are using img src="...", then use class="img-responsive" and in css width="100%".
it worked like that
<div class="carousel-item activo">
<a href="#" style="display: block; width: 100%; height: 100%;">
<img class="img-fluid d-block w-100" src="01.jpg" alt="Alternate Text" />
</a>
</div>
Need to change img css that please check
.carousel,
.carousel-inner {
height: 100vh;
}
.carousel img {
position: absolute;
top: 0;
left: 0;
min-width: 100%;
height: auto;
max-width: 100%;
}
<div class="carousel-inner" role="listbox">
<div class="item active">
<img class="img-responsive" src="photos/JO2_2978.JPG" alt="xmas_orchestra">
</div>
<div class="item">
<img src="photos/JO2_2875.JPG" alt="...">
</div>
<div class="item">
<img src="photos/IMG_1824.JPG" alt="...">
</div>
<div class="item">
<img src="photos/JO2_2955.JPG" alt="...">
</div>
<div class="item">
<img src="photos/IMG_3913.JPG" alt="...">
</div>
<div class="item">
<img src="photos/JO2_2957.JPG" alt="...">
</div>
</div> <!-- CAROUSEL-INNER -->
.carousel img {
position: absolute;
top: 0;
left: 0;
min-width: 100vw;
height: 100vh;
max-width: none;
object-fit:cover;
object-position:center;
}
Please replace you CSS code.