Bootstrap Carousel Percentages - html

Whenever I try to edit the height of a Bootstrap Carousel in percentage form(e.g, 100%) the carousel doesn't respond. How do I make the height of it 100%?
<div class="carousel-inner" role="listbox">
<div class="item">
<img class="first-slide" src="https://www.apple.com/osx/elcapitan-preview/static/osx-preview/overview/hero/image_large.jpg" alt="First slide">
<div class="container">
<div class="carousel-caption">
<h1>Utah Unicycling Society</h1>
<p>The only Unicycling Society in Utah</p>
</div>
</div>
</div>
<div class="item">
<img class="second-slide" src="http://images.nationalgeographic.com/wpf/media-live/photos/000/187/cache/canyons-utah_18730_990x742.jpg" alt="Second slide">
<div class="container">
<div class="carousel-caption">
<h1 style="color:#FFF">Join Us!</h1>
<p>Today, millions of people are realizing that unicycling is great. Join the Utah Unicycling Society, and become a better unicyler today.</p>
</div>
</div>
</div>
<div class="item active">
<img class="third-slide" src="New pictures/Hands Low.jpg" alt="Third slide">
<div class="container">
<div class="carousel-caption">
<h1 style="color:#FFF">Donate</h1>
<p>We can't get money if you don't donate!</p>
</div>
</div>
</div>
<div class="item">
<img class="fourth-slide" src="TheRoad.jpg" alt="Fourth slide">
<div class="container">
<div class="carousel-caption">
<h1>The Road to Success</h1>
<p>Here at Utah Unicycling Society, we believe in the road to success, and follow it every day.</p>
</div>
</div>
</div>
</div>
and the css
.carousel-inner{
width:100%;
height:100%;
}
Please help, if you can!!!

The carousel will respond to your img.
Define the "slide" class with the height you want like:
.first-slide {
height: 300px;
max-height: 300px;
}
Do that for all the four slides.

Related

Trying to create carousel for different resolutions BootstrapV4

I'm using BootstrapV4 for a carousel.
On each slide I have 3 cards appearing, but I would like to change this on the cell phone, I would like that on the cell phone only 1 card appears on each slide, I would also like to change the number of indicators.
That is, if I have a total of 6 cards, in higher resolutions there must be 2 slides each with 3 cards and if I have in smaller resolutions there must be 6 slides with 1 card in each slide, and the number of indicators must be equal to the number Slide.
My code:
<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">
<div class="carousel-item active">
<div class="row">
<div class="col-4">
<div class="card test-card border">
<div class="card-body">
<img src="..." alt="">
<h1 class="title">title</h1>
<h1 class="subtitle">subtitle</h1>
</div>
</div>
</div>
<div class="col-4">
<div class="card test-card border">
<div class="card-body">
<img src="..." alt="">
<h1 class="title">title</h1>
<h1 class="subtitle">subtitle</h1>
</div>
</div>
</div>
<div class="col-4">
<div class="card test-card border">
<div class="card-body">
<img src="..." alt="">
<h1 class="title">title</h1>
<h1 class="subtitle">subtitle</h1>
</div>
</div>
</div>
</div>
</div>
<div class="carousel-item">
<div class="row">
<div class="col-4">
<div class="card test-card border">
<div class="card-body">
<img src="..." alt="">
<h1 class="title">title</h1>
<h1 class="subtitle">subtitle</h1>
</div>
</div>
</div>
<div class="col-4">
<div class="card test-card border">
<div class="card-body">
<img src="..." alt="">
<h1 class="title">title</h1>
<h1 class="subtitle">subtitle</h1>
</div>
</div>
</div>
<div class="col-4">
<div class="card test-card border">
<div class="card-body">
<img src="..." alt="">
<h1 class="title">title</h1>
<h1 class="subtitle">subtitle</h1>
</div>
</div>
</div>
</div>
</div>
<div class="carousel-item">
<div class="row">
<div class="col-4">
<div class="card test-card border">
<div class="card-body">
<img src="..." alt="">
<h1 class="title">title</h1>
<h1 class="subtitle">subtitle</h1>
</div>
</div>
</div>
<div class="col-4">
<div class="card test-card border">
<div class="card-body">
<img src="..." alt="">
<h1 class="title">title</h1>
<h1 class="subtitle">subtitle</h1>
</div>
</div>
</div>
<div class="col-4">
<div class="card test-card border">
<div class="card-body">
<img src="..." alt="">
<h1 class="title">title</h1>
<h1 class="subtitle">subtitle</h1>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

How to place carousel and text side by side bootstrap?

I want a carousel to occupy half the page and to be aligned to the right while the text should be aligned to the left of the box.
I am using bootstrap. Here is my html:
.main{
display: flex;
align-items: center;
}
#events{
display: flex;
justify-content: space-evenly ;
}
.card{
border-radius: 5%;
}
#myNavbar{
align-items: center;
}
.impact{
margin: 10px;
}
<div class="main">
<div class="impact">
<span>
IMPACTING THE BANGLADESHI COMMUNITY IN OMAN!
</span>
</div>
<div id="carousel" class="carousel slide impact" data-bs-ride="carousel">
<div class="carousel-inner impact" style="height: 500px;">
<div class="carousel-item active">
<img src="{% static 'social_club/web1.jpg' %}" class="d-block w-100 h-100" alt="">
</div>
<div class="carousel-item">
<img src="{% static 'social_club/web2.jpg' %}" class="d-block w-100" alt="">
</div>
<div class="carousel-item">
<img src="..." class="d-block w-100" alt="..."> </div>
</div>
</div>
</div>
Could someone please tell me how I can make this possible? I have searched quite a lot about making the carousel only occupy half the page, but without results.
If you are using Bootstrap 4 or Bootstrap 5, you have no need to add custom CSS. You can achieve this by using Bootstrap classes. In the following code snippet, I am using Bootstrap 5.
Here is the complete implementation of your code. Please make sure to add closing tags correctly.
Note: Don't add static height to any element for an accurate vertically center alignment effect.
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"/>
<div class="main d-flex align-items-center">
<div class="impact w-50">
<span>
IMPACTING THE BANGLADESHI COMMUNITY IN OMAN!
</span>
</div>
<div id="carousel" class="carousel slide impact w-50" data-bs-ride="carousel">
<div class="carousel-inner impact">
<div class="carousel-item active">
<img src="https://blog.getbootstrap.com/assets/img/2020/06/v5-new-logo.png" class="d-block w-100 h-100" alt="">
</div>
<div class="carousel-item">
<img src="https://www.winklix.com/blog/wp-content/uploads/2021/01/f1ce6a0af5cb.jpg.png" class="d-block w-100" alt="">
</div>
<div class="carousel-item">
<img src="https://htmlburger.com/blog/wp-content/uploads/2021/02/lets-talk-about-bootstrap.png" class="d-block w-100" alt="...">
</div>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap#5.1.3/dist/js/bootstrap.bundle.min.js"></script>

How to align row to bottom in a nested column?

Expected
Im having trouble placing two smaller images next to one larger image using Bootstrap 4. However, I cannot seem to align one of the smaller images to bottom such that it is aligned as the bigger image.
The grid should be responsive as well as the image text.
Any help is appreciated.
<div class="container">
<div class="row">
<div class="col-md-6">
<img src="../assets/img/Iot.png" class="img-fluid">
<div class="carousel-caption text-justify" style="bottom: 0px;left: 10%;">
<h1 style="color:white !important">IoT</h1>
<p style="color:white !important">In the forefront of emerging technologies,
Internet of Things (IoT) applications are some of the most challenging and
innovative solutions to work with today... READ MORE</p>
</div>
</div>
<div class="col-md-6">
<div class="row">
<div class="col">
<img src="../assets/img/fintech.png" class="img-fluid">
<div class="carousel-caption text-justify" style="bottom: 0px;left: 10%;">
<h1 style="color:white !important">FinTech</h1>
<p style="color:white !important">The growth in digital banking is showing no
signs of slowing down. Convenience, speed and security aren’t just extra
benefits in consumers minds anymore... READ MORE</p>
</div>
</div>
</div>
<div class="row">
<div class="col">
<img src="../assets/img/smartapps.png" class="img-fluid">
<div class="carousel-caption text-justify" style="bottom: 0px;left: 10%;">
<h1 style="color:white !important">SmartApps</h1>
<p style="color:white !important">With people using their smartphones more and
more, they are now
demanding solutions that can help them complete their task event on the go…
READ MORE</p>
</div>
</div>
</div>
</div>
</div>
</div>
added height and width to each image
.big img{
height: calc(500px + 1.5em);
}
.small img{
height:250px;
width:100%
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js"></script>
<div class="container">
<div class="row">
<div class="col-md-6 big">
<img src="https://www.w3schools.com/w3css/img_lights.jpg" class="img-fluid">
<div class="carousel-caption text-justify" style="bottom: 0px;left: 10%;">
<h1 style="color:white !important">IoT</h1>
<p style="color:white !important">In the forefront of emerging technologies,
Internet of Things (IoT) applications are some of the most challenging and
innovative solutions to work with today... READ MORE</p>
</div>
</div>
<div class="col-md-6">
<div class="row small">
<div class="col">
<img src="https://www.w3schools.com/w3css/img_lights.jpg" class="img-fluid">
<div class="carousel-caption text-justify" style="bottom: 0px;left: 10%;">
<h1 style="color:white !important">FinTech</h1>
<p style="color:white !important">The growth in digital banking is showing no
signs of slowing down. Convenience, speed and security aren’t just extra
benefits in consumers minds anymore... READ MORE</p>
</div>
</div>
</div>
<div class="row mt-4 small">
<div class="col">
<img src="https://www.w3schools.com/w3css/img_lights.jpg" class="img-fluid">
<div class="carousel-caption text-justify" style="bottom: 0px;left: 10%;">
<h1 style="color:white !important">SmartApps</h1>
<p style="color:white !important">With people using their smartphones more and
more, they are now
demanding solutions that can help them complete their task event on the go…
READ MORE</p>
</div>
</div>
</div>
</div>
</div>
</div>

Container row alignment issue

I'm currently working on my first ever website, this is using the twitter-bootstrap 4 framework. Everything was going swimmingly, until I have seemingly encountered the following issue.
I currently have this layout for my website:
Current Layout
When in fact I would like:
Desired Layout
I have attempted a plethora of solutions that I have found via browsing stack-overflow, such as nesting columns. None of it seems to work, I'm sure it is simply due to my inexperience, but I'm stumped as to how to get my desired appearance.
<div class="container-fluid bg-style-2">
<div class="row">
<div class="col-sm-9 par-style"><h2 class="par-heading">Welcome to my Website</h2>
</div>
<div class="col-sm-3">
<div id="myCarousel" class="carousel slide pull-right" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"><img src="img/Christina.JPG" alt="..."></li>
<li data-target="#myCarousel" data-slide-to="1"><img src="img/NickyAndChristina.JPG" alt="..."></li>
<li data-target="#myCarousel" data-slide-to="2"><img src="img/Nicky.JPG" alt="..."></li>
<li data-target="#myCarousel" data-slide-to="3"><img src="img/Meme.JPG" alt="..."></li>
</ol>
<div class="carousel-inner">
<div class="carousel-item active">
<img class="d-block w-100" src="img/Christina.JPG" alt="First slide">
</div>
<div class="carousel-item">
<img class="d-block w-100" src="img/NickyAndChristina.JPG" alt="Second slide">
</div>
<div class="carousel-item">
<img class="d-block w-100" src="img/Nicky.JPG" alt="Third slide">
</div>
<div class="carousel-item">
<img class="d-block w-100" src="img/Meme.JPG" alt="Fourth slide">
</div>
</div>
</div>
</div>
</div>
</div> <!-- End of Carousel -->
<div class="container-fluid bg-style-2">
<div class="row">
<div class="col-sm-9 par-style"><h2 class="par-heading">Test Header</h2>
</div>
</div>
</div>
As seen above, I am trying to have a photo gallery slider to the right of my website and the formatting I have attached above, it simply will not work. Can someone please give me some guidance? I have been thoroughly enjoying working on this website, but I cannot progress until I have resolved this as it will plague my mind.
#nedge
https://jsfiddle.net/saurabhanand/4f0pztcu/2/
<div class="container">
<div class="row container-0">
<div class="col-sm-6">
<div class="row container-1">
<div class="col-sm-12">
<img class="rgt-side-img" src="https://via.placeholder.com/500x250">
</div>
</div>
<div class="row container-2">
<div class="col-sm-6">
<img class="rgt-side-img" src="https://via.placeholder.com/500">
</div>
<div class="col-sm-6">
<img class="rgt-side-img" src="https://via.placeholder.com/500">
</div>
</div>
</div>
<div class="col-sm-6">
<img class="rgt-side-img" src="https://via.placeholder.com/500">
</div>
</div>
</div>
I hope this one helps. You can replace img tag with your own contents.

Bootstrap carousel can't work with specific link on images

<div class="carousel-inner">
<div class="item active" >
<div class="carousel-caption">
<h3>Test</h3>
<p>
</p>
</div>
</div>
</div>
Here is my code.
Carousel slider worked correctly
and element was showed when i inspect it
but a images can't click in mobile and ipad version
can fix this
I've added onlick function into div elements
<div class="carousel-inner">
<div class="item active" onclick="window.open('test');" style="cursor: pointer;" >
<img src="/site_media/test_image.jpg" alt="test test" />
<div class="carousel-caption">
<h3>Test</h3>
<p></p>
</div>
</div>