Bootstrap 4 Carousel Control Buttons Not Working - html

Im not sure what i am doing wrong but for some reason bootstrap 4 carousel controls is not working if anyone can help I would really appreciate it. Ive been playing around with the code for about an hour so I figure ill get a 2nd opinion to see what is going on.
I looked at the bootstrap docs and I copied and pasted the controls. I looked at the classes and everything looks the same
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap#4.6.0/dist/css/bootstrap.min.css" integrity="sha384-B0vP5xmATw1+K9KRQjQERJvTumQW0nPEzvF6L/Z6nronJ3oUOFUFpCjEUQouq2+l" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous">
<!-- REVIEWS -->
<div id="reviews" class="py-3 bg-green" style="background: #186160;">
<div class="customer-reviews d-block text-center">
<h4> <strong> Customer Reviews </strong></h4>
<div style="color: #ffd400;"> ★ ★ ★ ★ ★</div>
<!-- SLIDER -->
<div class="col-lg-10 offset-lg-1 text-light">
<div id="carouselExampleControls" class="carousel slide" data-ride="carousel" >
<div class="carousel-inner" role="listbox">
<!-- SLIDER 1 -->
<div class="carousel-item active text-center pt-4 ">
<blockquote class="blockquote text-center">
<div class="d-flex justify-content-around">
<div>
<p class="mb-0"><i class=" "></i> "I absolutely love this site, probably better than cebook"</p>
<p style="color: #ffd400;">Tomi_Jug****</p>
</div>
<div>
<p class="mb-0"><i class=" "></i> "I love all the users on this site, everyone is fun to talk with."</p>
<p style="color: #ffd400;">Chris****</p>
</div>
</div>
</blockquote>
</div>
<!-- SLIDER 2 -->
<div class="carousel-item text-center pt-4 ">
<blockquote class="blockquote text-center">
<div class="d-flex justify-content-around">
<div>
<p class="mb-0"><i class=" "></i> "I like the freedom it gives me to express, in a safe manner."</p>
<p style="color: #ffd400;">YoruUs**</p>
</div>
<div>
<p class="mb-0"><i class=" "></i> "I love that it's easy to chat with someone. You have a great mobile app. Easy to use."</p>
<p style="color: #ffd400;">HG****</p>
</div>
</div>
</blockquote>
</div>
<!-- SLIDER 3 -->
<div class="carousel-item text-center pt-4 ">
<blockquote class="blockquote text-center">
<div class="d-flex justify-content-around">
<div>
<p class="mb-0"><i class=" "></i> "I like that the site has cool people on it, and I can almost always meet someone new."</p>
<p style="color: #ffd400;">Wet an******</p>
</div>
</div>
</blockquote>
</div>
<!-- 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>
<!-- SLIDER -->
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"
integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap#4.5.3/dist/js/bootstrap.bundle.min.js"
integrity="sha384-ho+j7jyWK8fNQe+A12Hb8AhRq26LrZ/JpcUGGOn+Y7RsweNrtN/tE3MoK7ZeZDyx"
crossorigin="anonymous"></script>

Ids are different.
Make changes as
<!-- Left and right controls -->
<a class="carousel-control-prev" href="#carouselExampleControls" data-slide="prev">
<span class="carousel-control-prev-icon"></span>
</a>
<a class="carousel-control-next" href="#carouselExampleControls" data-slide="next">
<span class="carousel-control-next-icon"></span>
</a>
and check

Related

Bootstrap4 card-title causing icon to overflow

I am tyring to create a card in bootstrap4 that has expand/collapse behavior with a red close 'X' button. I'm very close to having it done, but when I move my red x close icon outside the element that controls the expand/collapse logic, it moves the red close button to a lower row?
I tried changing margin-right and padding-right but wasn't able to fix it, can someone help?
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<div class="card ml-5 mr-5 mt-5">
<h5 class="card-header expandable">
<a style='padding-right:-10px' data-toggle="collapse" href="#collapse-example1" aria-expanded="true" aria-controls="collapse-example1" id="heading-example" class="d-block">
<i class="rotate fa fa-chevron-down "></i>
good style
<i style='color:red' class="fa fa-close pull-right"></i>
</a>
</h5>
<div id="collapse-example1" class="collapse show" aria-labelledby="heading-example">
<div class="card-body">
card body
</div>
</div>
</div>
<div class="card ml-5 mr-5 mt-5">
<h5 class="card-header expandable">
<a style='padding-right:-10px' data-toggle="collapse" href="#collapse-example" aria-expanded="true" aria-controls="collapse-example" id="heading-example" class="d-block">
<i class="rotate fa fa-chevron-down "></i>
uh oh card-title margin looks weird?
</a>
<i style='color:red' class="fa fa-close pull-right"></i>
</h5>
<div id="collapse-example" class="collapse show" aria-labelledby="heading-example">
<div class="card-body">
card body
</div>
</div>
</div>
https://jsfiddle.net/martinradio/s0ygr35L/8/
You do no need to use d-block on the a - Bootstrap will apply its own CSS and adjust the elements responsively and accordingly. I have removed the d-block and its working fine.
Working Fiddle Demo: https://jsfiddle.net/usdj51ga/
.expandable .fa {
transition: .3s transform ease-in-out;
}
.expandable .collapsed .rotate.fa {
transform: rotate(180deg);
}
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<!-- Popper JS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"></script>
</head>
<div class="card ml-5 mr-5 mt-5">
<h5 class="card-header expandable">
<a style='padding-right:-10px' data-toggle="collapse" href="#collapse-example1" aria-expanded="true" aria-controls="collapse-example1" id="heading-example">
<i class="rotate fa fa-chevron-down "></i> good style
<i style='color:red' class="fa fa-close pull-right"></i>
</a>
</h5>
<div id="collapse-example1" class="collapse show" aria-labelledby="heading-example">
<div class="card-body">
card body
</div>
</div>
</div>
<div class="card ml-5 mr-5 mt-5">
<h5 class="card-header expandable">
<a style='padding-right:-10px' data-toggle="collapse" href="#collapse-example" aria-expanded="true" aria-controls="collapse-example" id="heading-example1">
<i class="rotate fa fa-chevron-down "></i> Yes! card-title margin looks Good!
</a>
<i style='color:red' class="fa fa-close pull-right"></i>
</h5>
<div id="collapse-example" class="collapse show" aria-labelledby="heading-example">
<div class="card-body">
card body
</div>
</div>
</div>
I have added CSS3 display:flex property on your expandable div to make it inline.
Click below to check working example:
Working Example

Bootstrap-4 card responsive image / text columns overlapping

I have 2 cards next to each other, I'm trying to design it such that they will always have the same height, and I'm having some trouble getting my left box to look nice with no overlap.
Currently I have two elements in the left box, an image element and a text element. I'm trying to style the left box such that the elements don't overlap and that the box is responsive when resized.
In my jsfiddle (https://jsfiddle.net/martinradio/jshet597/27/) it currently looks like this:
<br>
<div class="container-fluid">
<div class="row">
<!-- Left Box -->
<div class="col-md-4">
<div class="card mb-4 box-shadow" style=height:100%>
<div class="card-body ">
<div class="row align-items-center mb-4">
<div class="col">
<!-- Title -->
<h4 class="mb-2">
Left Box
</h4>
</div>
</div>
<div class="container h-100">
<div class=" justify-content-center align-items-center">
<div class="row ">
<!-- img -->
<div class="col-md-4">
<div class="">
<img class="img-fluid" src="https://www.kroger.com/product/images/medium/front/0004900005537" />
</div>
</div>
<!-- text -->
<div class="col-md-8 my-auto">
<div>INFO1:STUFFHERE</div>
<div>INFO2:MORESTUFFHERE</div>
<div>INFO3:EVENMORESTUFF,COOLHUH?</div>
</div>
</div> <!-- / .row -->
</div>
</div>
</div>
</div>
</div> <!-- /col -->
<!-- Right Box -->
<div class="col-md-8">
<div class="card mb-4 box-shadow" style=height:100%>
<div class="card-body">
<!-- Right Box -->
<div class="row align-items-center mb-4">
<div class="col">
<!-- Title -->
<h4 class="mb-2">
Right Box
</h4>
<!-- Subtitle -->
<p class="small text-muted mb-0">
Last Updated March 20, 2020
</p>
</div>
</div>
<!-- Top Row -->
<div class="row">
<!-- My Price -->
<div class="col-sm-2">
<h4 class="text-muted">My Price <span class="h4 fe fe-help-circle text-dark" data-toggle="tooltip" title="" data-original-title="Additional Info On My Price" ></span></h4>
</div>
<!-- Competitor Low Price -->
<div class="col-md-3 border-left">
<h4 class="text-muted">adasd <span class="h4 fe fe-help-circle text-dark" data-toggle="tooltip" title="" data-original-title="Additional Info On Competitor Low Price" ></span></h4>
<span class="h2 mb-0" id='competitiveLandscape_compLowPrice'>$1.29</span>
<br>
<h5 class="text-muted mt-1">z</h5>
</div>
<!-- Competitor High Price -->
<div class="col-md-3 border-left">
<h4 class="text-muted">ad <span class="h4 fe fe-help-circle text-dark" data-toggle="tooltip" title="" data-original-title="Additional Info On Competitor High Price" ></span></h4>
<span class="h2 mb-0" id='competitiveLandscape_compHighPrice'>$2.19</span>
<br>
<h5 class="text-muted mt-1">x</h5>
</div>
<!-- Competitor Price Index -->
<div class="col-md-3 border-left">
<h4 class="text-muted">sd <span class="h4 fe fe-help-circle text-dark" data-toggle="tooltip" title="" data-original-title="Additional Info On Competitor Price Index" ></span></h4>
<span class="h2 mb-0" id="competitiveLandscape_cpi">1.09</span>
<br>
<span id='cpiNumSpan' class="badge mt-n1"><i id='cpiNumIcon' class="fe "></i> 230 BPS</span>
</div>
</div>
<br>
<!-- Bottom Row -->
<div class="row">
<!-- Competitors -->
<div class="col-sm-2">
<h4 class="text-muted">df <span class="h4 fe fe-help-circle text-dark" data-toggle="tooltip" title="" data-original-title="Additional Info On Competitors" ></span></h4>
<span class="h2 mb-0" id='competitiveLandscape_competitors'>12</span>
<br>
<span class="badge badge-soft-danger mt-n1"><i class="fe fe-arrow-down"></i> 3</span>
</div>
<!-- Price Position -->
<div class="col-md-3 border-left">
<h4 class="text-muted">dfssdf <span class="h4 fe fe-help-circle text-dark" data-toggle="tooltip" title="" data-original-title="Additional Info On Price Position" ></span></h4>
<span class="h2 mb-0" id='competitiveLandscape_pricePosition'>3</span>
<br>
<span class="badge badge-soft-success mt-n1"><i class="fe fe-arrow-up"></i> 1</span>
</div>
<!-- Price Gap -->
<div class="col-md-3 border-left">
<h4 class="text-muted">sdfsdf <span class="h4 fe fe-help-circle text-dark" data-toggle="tooltip" title="" data-original-title="Additional Info On Price Gap" ></span></h4>
<span class="h2 mb-0" id='competitiveLandscape_priceGap'>35%</span>
<br>
<span class="badge badge-soft-danger mt-n1"><i class="fe fe-arrow-down"></i> 50 BPS</span>
</div>
<!-- Price Competitiveness -->
<div class="col-md-3 border-left">
<h4 class="text-muted">sdfsdf <span class="h4 fe fe-help-circle text-dark" data-toggle="tooltip" title="" data-original-title="Additional Info On Price Competitiveness" ></span></h4>
<span class="h2 mb-0" id='competitiveLandscape_priceCompetitiveness'>84%</span>
<br>
<span class="badge badge-soft-success mt-n1"><i class="fe fe-arrow-up"></i> 400 BPS</span>
</div>
</div>
</div>
</div>
</div>
</div> <!-- /row -->
</div>
Adding img-fluid helped with the responsiveness by preventing overlap, but has the side-effect of causing the image to appear very small, I tried to fix this by adding style="max-width:6" but it's not affecting the image.
The img-fluid tag has even caused the image / text to no longer be centered.
Is there a way I can get my img / text to stay aligned in the center of the card, with the image larger, while also retaining responsiveness so when it is resized there is no overlap?
Thanks
If I understand correctly, you want to center your left box, don't want to overlap content with image and keep your box height the same as the right side.
I removed .container, .row and .h-100 classes from your code and also removed some unwanted div from your code for getting a suitable result.
HERE IS YOUR CODE
https://jsfiddle.net/w5pzcxn6/

Bootstrap carousel item content in two seperate div horizontally

I have a bootstrap carousel in which on each carousel item I am using an image & some text. I want each carousel item to be shown horizontally. But the bootstrap carousel item show me content vertically as shown in the image below.
This is what currently i am getting:
This is what I want each carousel item to look like:
Here is my source code: (Two Carousel items in it)
<div class="g-bg-img-hero" style="background-image: url(dist/images/newPage/svg-bg3.svg);">
<div class="container g-py-50">
<div class="row">
<div id="carouselExampleControls" class="carousel slide" data-ride="carousel">
<div class="carousel-inner" role="listbox">
<div class="carousel-item active">
<div class="col-md-6 g-mb-0--md">
<img class="img-fluid u-shadow-v39 g-brd-around g-brd-10 g-brd-white rounded"
src="dist/images/newPage/biggest-expo-on-stem-cells-in-karachi.png" alt="Biggest Stem Cells Conference">
</div>
<div class="col-md-5">
<div class="mb-4">
<h4 class="g-color-black mb-3">$28m Funding Investment for New University of Unify Research</h4>
<p>Food security, epigenetics, media ownership and space weather are among the topics that will be investigated as part of a $28 million funding injection to Unify research from the Australian Research Council (ARC).</p>
</div>
<a class="btn u-shadow-v33 g-color-white g-bg-primary g-bg-black--hover g-font-size-default g-rounded-30 g-px-35 g-py-11" href="#">Read More</a>
</div>
</div>
<div class="carousel-item">
<div class="col-md-6 g-mb-0--md">
<img class="img-fluid u-shadow-v39 g-brd-around g-brd-10 g-brd-white rounded"
src="dist/images/newPage/hira-shaikh.jpg" alt="Nida Yasir Trust on AlKhaleej Clinics">
</div>
<div class="col-md-5">
<div class="mb-4">
<h4 class="g-color-black mb-3">$28m Funding Investment for New University of Unify Research</h4>
<p>Food security, epigenetics, media ownership and space weather are among the topics that will be investigated as part of a $28 million funding injection to Unify research from the Australian Research Council (ARC).</p>
</div>
<a class="btn u-shadow-v33 g-color-white g-bg-primary g-bg-black--hover g-font-size-default g-rounded-30 g-px-35 g-py-11" href="#">Read More</a>
</div>
</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>
</div>
</div>
Well, your structure is incorrect. You need to have the following structure inside each carousel item:
.carousel > .carousel-item > .row > .col-4 + .col-6
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
<div class="g-bg-img-hero bg-info">
<div class="container g-py-50">
<div class="row">
<div id="carouselExampleControls" class="carousel slide" data-ride="carousel">
<div class="carousel-inner" role="listbox">
<div class="carousel-item active">
<div class="row m-0 p-0">
<div class="col-4 col-md-4 g-mb-0--md">
<img class="img-fluid u-shadow-v39 g-brd-around g-brd-10 g-brd-white rounded" src="https://via.placeholder.com/300x200" alt="Biggest Stem Cells Conference">
</div>
<div class="col-8 col-md-8">
<h4 class="g-color-black mb-3">Item 1 - $28m Funding Investment for New University of Unify Research</h4>
<p>Food security, epigenetics, media ownership and space weather are among the topics that will be investigated as part of a $28 million funding injection to Unify research from the Australian Research Council (ARC).</p>
<a class="btn u-shadow-v33 g-color-white g-bg-primary g-bg-black--hover g-font-size-default g-rounded-30 g-px-35 g-py-11" href="#">Read More</a>
</div>
</div>
</div>
<div class="carousel-item">
<div class="row m-0 p-0">
<div class="col-4 col-md-4 g-mb-0--md">
<img class="img-fluid u-shadow-v39 g-brd-around g-brd-10 g-brd-white rounded" src="https://via.placeholder.com/300x200" alt="Biggest Stem Cells Conference">
</div>
<div class="col-8 col-md-8">
<h4 class="g-color-black mb-3">Item 2 - $28m Funding Investment for New University of Unify Research</h4>
<p>Food security, epigenetics, media ownership and space weather are among the topics that will be investigated as part of a $28 million funding injection to Unify research from the Australian Research Council (ARC).</p>
<a class="btn u-shadow-v33 g-color-white g-bg-primary g-bg-black--hover g-font-size-default g-rounded-30 g-px-35 g-py-11" href="#">Read More</a>
</div>
</div>
</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>
</div>
</div>

Bootstrap carousel is filling my whole page

I would like a carousel that fills about half of the window. I've been reading through the documentation https://getbootstrap.com/docs/4.1/components/carousel/ and a following a youtube tutorial for help https://youtu.be/9cKsq14Kfsw?t=3510. My images fill the entire page plus more (when scrolled down) and I can't figure out how to make it smaller other than setting a fixed height in CSS which makes the image look squashed.
Here is my code
html, body {
width: 100%;
height: 100%;
}
.carousel-inner img {
width: 100%;
height: 100%;
}
<!-- Image carousel -->
<div id="slides" class="carousel slide" data-ride="carousel">
<!-- Carousel images -->
<div class="carousel-inner">
<div class="carousel-item active">
<img src="img/home-1.png" />
<div class="carousel-caption">
<h1 class="display-2">Garnet Home Inspections</h1>
</div>
</div>
<div class="carousel-item">
<img src="img/home-2.png" />
<div class="carousel-caption">
<h1 class="display-3">Service Area</h1>
<h3>I travel all over the capital Region</h3>
<button type="button" class="btn btn-outline-light btn-lg">SET UP AN APPOINTMENT</button>
</div>
</div>
<div class="carousel-item">
<img src="img/home-3.png" />
<div class="carousel-caption">
<!-- put content here -->
</div>
</div>
</div>
<!-- Carousel buttons-->
<a class="carousel-control-prev" href="#slides" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span> <!-- Screenreaders only -->
</a>
<a class="carousel-control-next" href="#slides" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span> <!-- Screenreaders only -->
</a>
</div>
Thank you in advance :)
If anyone needs more information/code please let me know.

bootstrap carousel two slide shows appear simultaneously

I have several photo albums (thumbnails, links) on one page. The idea is that when the user clicks on the thumbnail the bootstrap carousel slide show pops up with pictures from this album.
The HTML for one of the albums looks like this (the second one is identical):
<div class="container">
<div class="row">
<!-- Album 1 -->
<div class="col-sm-12 col-md-3 col-lg-3 box">
<span class="spanner"></span>
<div class=thumbnail style="background-image: url(image1.jpg);">
<div class="caption">
<h4>Album 1</h4>
<p class="photo-text">Album 1 description</p>
</div>
</div>
<div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item active">
<img class="img-responsive" src="image1.jpg" alt="image1">
</div>
<div class="item">
<img class="img-responsive" src="image2.jpg" alt="image2">
</div>
</div>
<!-- Controls -->
<a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
</a>
<a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
The problem is when I press on the album thumbnail both slide shows pop-up. I assume the problem is with "active" but I am not sure how to fix it. Thanks!
Check and make sure both carousels have a different id. Are you using the id to load the carousel?