How to get multiple slider - html

I want to have automatic multiple sliders and they should be side by side, each sliding in different periods of time.
I am a beginner coder and tried to make this work by trying myself and searching for solutions but nothing works, it would be great if i got the code how to do it

If you add bootstrap to your code you can use this:
<div id="carouselExampleSlidesOnly" class="carousel slide" data-bs-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active">
<img src="..." class="d-block w-100" alt="...">
</div>
<div class="carousel-item">
<img src="..." class="d-block w-100" alt="...">
</div>
<div class="carousel-item">
<img src="..." class="d-block w-100" alt="...">
</div>
</div>
</div>
Add the desired picture's location to img tag's src attribute and it will automaticly start to slide.
Note: To add bootstrap check this https://getbootstrap.com/docs/5.0/getting-started/introduction/

Related

Bootstrap 5 carousel of multiple items overlap and active slide larger than previous and next slide

I need a carousel based on attached image. my code below is only showing every active slide. Any idea how to adjust the size of the active slide and a little bit smaller for previous and next slide and overlaps with each other so that the active slide is at the center?
tia
<div id="carouselExampleSlidesOnly" class="carousel slide mt-5 mx-3" data-bs-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active">
<img class="d-block w-100" src="<?php echo IMAGES; ?>/girl-player.jpg" alt="First slide">
</div>
<div class="carousel-item">
<img class="d-block w-100" src="<?php echo IMAGES; ?>/pixel-player.jpg" alt="Second slide">
</div>
<div class="carousel-item">
<img class="d-block w-100" src="<?php echo IMAGES; ?>/pixel-player.jpg" alt="Third slide">
</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>

Bootstrap 5+ carousel with cards based on viewport (screen size)

I have been searching quite some time for this but unfortunately all questions/answers are mostly 6/8 years old. Now that Bootstrap has evolved so much, I want to ask the question as maybe someone knows how to do this.
My requirement is to have a carousel of cards that adapts based on viewport, for example:
Default size: 3 items
Mobile size: just 1 item
This snippet is perfect for my needs: https://gosnippets.com/snippets/bootstrap-carousel-with-cards-in-3-columns, however I was unable to achieve what I want.
I have also played around with Slick carousel, but frankly I'm not a fan. It does exactly what I need but it's outdated, bugged and I would be much happier to use just bootstrap.
My project uses Webpack so I am able to use SCSS if that helps.
Please let me know if it's possible to achieve what I want with just plain Bootstrap 5.
You can do that in plain bootstrap by calling two carousel. Here is the following code and hopefully you will understand the code pattern.
<div id="carouselExampleSlidesOnly" class="carousel slide" data-ride="carousel">
<div class="carousel-inner d-none d-sm-block"> //d-none: display none for all devices, d-sm-block: hide on screens smaller than sm (width < 768px)
//loops start
<div class="carousel-item active">
<div class="container">
<div class="row">
<div class="col-sm">
<img src="..." class="d-block w-100" alt="...">
</div>
<div class="col-sm">
<img src="..." class="d-block w-100" alt="...">
</div>
<div class="col-sm">
<img src="..." class="d-block w-100" alt="...">
</div>
</div>
</div>
</div>
//loops end
</div>
<div class="carousel-inner d-sm-none">//d-sm-none: hide on sm (width < 768px) and wider screens
<div class="carousel-item active">
<img src="..." class="d-block w-100" alt="...">
</div>
<div class="carousel-item">
<img src="..." class="d-block w-100" alt="...">
</div>
<div class="carousel-item">
<img src="..." class="d-block w-100" alt="...">
</div>
</div>
</div>
Wish you good luck.

Bootstrap slider not giving the expected result

I was trying to make a carousel for my website using Bootstrap, but the carousel just gives me this icon:
My Google dev tools did not give me errors, the same can be said for Pycharm; no errors. Here is my code:
<div class="container">
<div id="carouselExampleSlidesOnly" class="carousel slide" data-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active">
<img src="C:\Users\pert\PycharmProjects\milestonewebsite\images\one.jpg" class="d-block w-100" alt="...">
</div>
<div class="carousel-item">
<img src="C:\Users\pert\PycharmProjects\milestonewebsite\images\two.jpg" class="d-block w-100" alt="...">
</div>
<div class="carousel-item">
<img src="C:\Users\pert\PycharmProjects\milestonewebsite\images\three.jpg" class="d-block w-100" alt="...">
</div>
</div>
</div>
</div>
ok, i found out the problem, for some reson, my computer only accepted gif links, now it is working properly

Adding URL link to a picture

So I have this carousel making my website 'fancy'. But I want to link the individual pictures to the websites it should got to once clicked on.
The following is my code:
<div class="carousel-item active">
<img class="d-block w-100" src="images/ncaa-bb-banner-1920x500 (1).png" alt="First slide" >
<div class="carousel-caption d-none d-md-block" >
<h5 href="sportsevents.php">Sport Events</h5>
</div>
</div>
I have added href="sportsevents.php" to the first div, img and the second div, but it doesn't seem to link up. Am I having a brain fart and missing something or is there something else I should do?
You can do like this and get desired result.
<div class="carousel-item active">
<img class="d-block w-100" src="images/ncaa-bb-banner-1920x500 (1).png" alt="First slide" >
<div class="carousel-caption d-none d-md-block" >
<h5>Sport Events</h5>
</div>
</div>