i'm currently developing a landing page for a startup, while i was making the "hero section" i wanted to use a carousel, everything worked fine until i tried adding the next section, to my surprise the next section was BEHIND the hero section, i tried reading through my code and tweaking a bit on chrome dev tools but i can't seem to find the problem, could you help me?
I've tried changing the position for all of the items in the carousel to static and their display to block to see if it went back to normal without success.
CODE:
HTML
<section id='hero-section'>
<div class="hero-carousel carousel slide" data-ride="carousel">
<div class="carousel-item active" data-interval="8000">
<img class="d-block w-100" src="includes/media/images/slide1.png" alt="">
<div class="carousel-caption d-none d-md-block">
<h2>Alcanza tus sueños</h2>
<p>Los créditos de nómina Axelera son fáciles de obtener y de pagar</p>
<button class='cta-button btn btn-md' type="button" name="button">Solicita tu crédito</button>
</div>
</div>
<div class="carousel-item" data-interval="8000">
<img class="d-block w-100" src="includes/media/images/slide2.png" alt="">
</div>
<div class="carousel-item" data-interval="8000">
<img class="d-block w-100" src="includes/media/images/slide3.png" alt="">
</div>
</div>
</section>
<section>
<h2>Test</h2>
</section>
CSS
.carousel-item img{
height: 500px;
object-fit: cover;
}
The next section (the one with the h2 "test" tag) should be below not behind the other section.
Just add the Bootstrap class clearfix and you are good to go!
.carousel-item img{
height: 500px;
object-fit: cover;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.2.1/css/bootstrap.min.css" rel="stylesheet"/>
<section class="clearfix" id='hero-section'>
<div class="hero-carousel carousel slide" data-ride="carousel">
<div class="carousel-item active" data-interval="8000">
<img class="d-block w-100" src="https://via.placeholder.com/960x500" alt="">
<div class="carousel-caption d-none d-md-block">
<h2>Alcanza tus sueños</h2>
<p>Los créditos de nómina Axelera son fáciles de obtener y de pagar</p>
<button class='cta-button btn btn-md' type="button" name="button">Solicita tu crédito</button>
</div>
</div>
<div class="carousel-item" data-interval="8000">
<img class="d-block w-100" src="https://via.placeholder.com/960x500" alt="">
</div>
<div class="carousel-item" data-interval="8000">
<img class="d-block w-100" src="https://via.placeholder.com/960x500" alt="">
</div>
</div>
</section>
<section class="clearfix">
<h2>Test</h2>
</section>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.2.1/js/bootstrap.bundle.min.js"></script>
Related
I currently want to implement an image carousel from bootstrap on a page. The only problem is, that i have on the first run, when i load the page, the bug that the images load too slowly or it's a general bug, that the next picture is for a half second white. But only on the first run.
Steps to reproduce:
Firefox 109.0 (64-Bit)
Boostrap CSS + JS import [https://getbootstrap.com/docs/5.3/getting-started/download/]
css/bootstrap.css;
bootstrap.bundle.js
EDIT:
Got it fixed to have no more white spaces, but not the nice way.
I made the size of the pictures smaller and now it loads fast enough.
So on my question now is, if it's possible to only slide to the next picture if it's already fulled loaded/rendered.
At around 3s you can zoom in and get deeper into it. https://share.firefox.dev/3wujvGC
Code of the carousel:
<div class="containerCarousel">
<div class="textCentering position-absolute">
<div class="textoverlay">
<h1 class="text-light textVonOverlay mx-3 mx-md-5 mt-5 display-5">Lorem Ipsum</h1>
<h3 class="text-light textVonOverlay mx-3 mx-md-5 mt-1 opacity-75">Lorem Ipsum</h3>
<h5 class="text-light textVonOverlay mx-3 mx-md-5 mt-1">Lorem Ipsum</h4>
<button type="button" class="btn btn-secondary btn-lg mx-3 mx-md-5 mt-5 mb-5" >Lorem Ipsum</button>
</div>
</div>
<div id="carouselExampleSlidesOnly" class="carousel slide" data-bs-ride="carousel" data-bs-pause="false">
<div class="carousel-inner">
<div class="carousel-item active">
<img src="/images/background1_barenstein.jpg" class="d-block w-100 heightCarousel " alt="...">
</div>
<div class="carousel-item ">
<img src="/images/background2_barenstein.jpg" class="d-block w-100 heightCarousel " alt="...">
</div>
<div class="carousel-item ">
<img src="/images/background3_barenstein.jpg" class="d-block w-100 heightCarousel " alt="...">
</div>
<div class="carousel-item ">
<img src="/images/background4_barenstein.jpg" class="d-block w-100 heightCarousel" alt="...">
</div>
<div class="carousel-item ">
<img src="/images/background5_barenstein.jpg" class="d-block w-100 heightCarousel" alt="...">
</div>
</div>
</div>
</div>
.heightCarousel{
height: 100vh;
object-fit: cover;
}
.textCentering{
display: flex;
align-items: center;
justify-content: center;
height: 100%;
width: 100%;
z-index: 1023;
}
.textoverlay{
width: 80vw;
background-color: rgb(46, 46, 46, 0.7);
}
.textVonOverlay{
opacity: 1 !important;
}
.containerCarousel{
position: relative;
}
I searched through the internet and tried some stuff, but nothing worked.
Read through some bugzilla and some stackoverflow questions, but i didn't find an answer which worked for me.
Edit:
Short video of an mozilla analysis of the problem with some data to identify problems
https://drive.google.com/file/d/1IpeyQBr6pdWN1gD__DPq_aKRprNNoAbw/view?usp=sharing
I'm building a new website, I'm using bootstrap 5. i have added a responsive carousel to the header field, but the text and button in the carousel are not compatible. I am adding a few images and source code to better understand the problem.
<!-- Carousel -->
<div id="demo" class="carousel slide" data-bs-ride="carousel">
<!-- Indicators/dots -->
<div class="carousel-indicators">
<button type="button" data-bs-target="#demo" data-bs-slide-to="0" class="active"></button>
<button type="button" data-bs-target="#demo" data-bs-slide-to="1"></button>
<button type="button" data-bs-target="#demo" data-bs-slide-to="2"></button>
<button type="button" data-bs-target="#demo" data-bs-slide-to="3"></button>
<button type="button" data-bs-target="#demo" data-bs-slide-to="4"></button>
</div>
<div class="carousel-inner">
<div class="carousel-item active">
<img src="images/slider/5.png" alt="Los Angeles" class="d-block img-fluid" style="width:100%">
<div class="carousel-caption">
<h3>BİZİ ARAMAKTAN ÇEKİNMEYİN</h3>
<p>Teknik Destek Hizmetleri</p>
<p>+90 850 111 11 11</p>
<button type="button" class="btn btn-outline-danger">Detaylı Bilgi</button>
</div>
</div>
<div class="carousel-item">
<img src="images/slider/1.png" alt="" class="d-block" style="width:100%">
<div class="carousel-caption">
<h3>Yakınınızda bir <span style="color:#0597d4;">3CX</span> Distribütörü arıyorsanız, doğru
yerdesiniz.</h3><br />
<button type="button" class="btn btn-outline-info">Detaylı Bilgi</button>
</div>
</div>
<div class="carousel-item">
<img src="images/slider/7.png" alt="" class="d-block" style="width:100%">
<div class="carousel-caption">
<h3>Fortinet BİLİŞİM</h3>
<p><span style="color: red; ">FORTİNET TÜRKİYENİN</span> SELECT PARTNERİ</p>
</div>
</div>
<div id="special" class="carousel-item">
<img src="images/slider/12.png" alt="" class="d-block" style="width:100%">
<div class="carousel-caption">
<h3>Sektör tecrübemizi yeni neslin çalışma koşulları ile
birleştirerek,</h3>
<p>kurumların iç dinamiklerine özel avantajlı
çözüm üretme vizyonundan yola çıktık.</p>
</div>
</div>
<div class="carousel-item">
<img src="images/slider/15.png" alt="" class="d-block" style="width:100%">
<div class="carousel-caption">
<h3>Fortinet olarak, yerel alan ağı, uzak ağ, kablosuz ağ, ağ güvenliği ve güvenli uzaktan erişim gibi
</h3>
<p>ağ teknolojilerinin kurulumu ve devreye alınması gibi ağ çözümlerini sunuyoruz.</p>
</div>
</div>
</div>
</div>
<!-- Carousel -->
CSS code
.carousel-caption{
transform: translateY(-50%) ;
bottom: initial;
top: 50%;
}
enter image description here
enter image description here
try to add d-flex class to the carousel-caption, also add align-items-center
<div class="carousel-caption align-items-center d-flex">
<h3>BİZİ ARAMAKTAN ÇEKİNMEYİN</h3>
<p>Teknik Destek Hizmetleri</p>
<p>+90 850 111 11 11</p>
<button type="button" class="btn btn-outline-danger">Detaylı Bilgi</button>
</div>
I'm having trouble making the carousel actually slide. It would just swap to next item without any "slide" transition. I've even went through the BS 5 doc and it doesn't do the slide transition either. Has it been removed?
HTML:
<div id="carouselExampleSlidesOnly" class="carousel slide" data-bs-slide ="true" data-bs-ride="carousel" data-bs-interval="1000" data-bs-pause="hover">
<div class="carousel-inner">
<div class="carousel-item active " style = "background-color:red">
<img src="..." class="d-block w-100" alt="...">
</div>
<div class="carousel-item" style = "background-color:blue">
<img src="..." class="d-block w-100" alt="...">
</div>
<div class="carousel-item" style = "background-color:yellow">
<img src="..." class="d-block w-100" alt="...">
</div>
</div>
</div>
CSS:
.carousel-item {
height: 500px;
}
Windows 10 > Display > Tick show animations in windows
I have a bootstrap carousel on which I want to place a card with text.
The problem is that that whatever I try, it's not putting it on top.
This is what I want:
Thi is the code:
<section id="hero">
<div class="vh-72">
<div id="carouselExampleFade" class="carousel slide carousel-fade" data-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active">
<img src="images/carousel_1.jpg" class="d-block w-100" alt="Carousel image one">
</div>
<div class="carousel-item">
<img src="images/carousel_2.jpg" class="d-block w-100" alt="Carousel image two">
</div>
</div>
</div>
<div class="container bg-danger">
<div class="row">
<div class="col-md-6 col-sm-12">
<div class="card">
<h1>Some title text <br> bla bla </h1>
Optimieren Sie Ihre Unternehmenserfolg durch Auslagerung Ihrer Produktionsleistung und gestalten Sie Ihre
Prozesse zukunftsorientiert.
Unser Team Nord Ihnen kompetente Mitarbeiter in Produktionsprozessen der industriellen Herstellung. <br>
<button> test </button>
</div>
</div>
</div>
</div>
</div>
</section>
I've tried using position: absolute with z-index, but it just moves it wrong.
Here is the JSFiddle: https://jsfiddle.net/txyzs8fk/
Can you please check the below code? Hope it will work for you. We gave position relative to #hero div and added one parent div hero-description of Card and gave position absolute and z-index, also we have set it's position using bootstrap utility class.
Please refer this link https://jsfiddle.net/8mdaqoup/
.row {
margin-top: 20px;
}
.col {
border: solid 1px #6c757d;
padding: 10px;
}
#hero { position:relative;}
.hero-description { height:100%; width:100%; position:absolute; top:0; left:0; z-index:1;}
.hero-description .card { padding:30px; }
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.js"></script>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.css" rel="stylesheet"/>
<section id="hero">
<div class="vh-72">
<div id="carouselExampleFade" class="carousel slide carousel-fade" data-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active">
<img src="https://images.unsplash.com/photo-1608096299230-81c7b43d5dfc?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1349&q=80"
class="d-block w-100" alt="Carousel image one">
</div>
<div class="carousel-item">
<img src="https://images.unsplash.com/photo-1583513702439-2e611c58e93d?ixlib=rb-1.2.1&ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&auto=format&fit=crop&w=1349&q=80"
class="d-block w-100" alt="Carousel image two">
</div>
</div>
</div>
<div class="hero-description">
<div class="container h-100">
<div class="row h-100 align-items-center">
<div class="col-md-6 col-sm-12">
<div class="card">
<h1>Some text <br> bla bla bla </h1>
<p>
Optimieren Sie Ihre Unternehmenserfolg durch Auslagerung Ihrer Produktionsleistung und gestalten Sie Ihre Prozesse zukunftsorientiert. Unser Team Nord Ihnen kompetente Mitarbeiter in Produktionsprozessen der industriellen Herstellung.
</p>
<button> test </button>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
I´m a designer with some coding skills, but far from being a programmer. Currently I´m working in a website based on a Bootstrap template, doing good enough except an issue that is driving me nuts: apparently Bootstrap´s CSS is overriding the site CSS, adding a fixed head in the index.html header, which contains a div that contains an image carousel.
Displaying the site in small devices (tablets and cell phones), the carousel hides properly using "hidden-xs" and "hidden-xm" classes, but the header remains with a fixed height of 929px as Element Inspector shows, generating a very tall empty space before the next section.
Below you´ll find the header code, including carousel:
<header id="intro">
<!-- CAROUSEL STARTS -->
<div id="myCarousel" class="carousel slide hidden-xs hidden-xm" data-ride="carousel" data-interval="2000" style="border:1px solid red;">
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<img class="d-block img-fluid" src="img/header-01.jpg" align="left" alt="Slide 01">
<!-- <div class="carousel-caption">
<p>El conocimiento es libertad</p>
</div> -->
</div>
<div class="item">
<img class="d-block img-fluid" src="img/header-02.jpg" alt="Slide 02">
<!-- <div class="carousel-caption">
<p>El respeto a sí mismo</p>
</div> -->
</div>
<div class="item">
<img class="d-block img-fluid" src="img/header-03.jpg" alt="Slide 03">
<!-- <div class="carousel-caption">
<p>El respeto a los demás</p>
</div> -->
</div>
<div class="item">
<img class="d-block img-fluid" src="img/header-04.jpg" alt="Slide 04">
<!-- <div class="carousel-caption">
<p>Jardín - Primaria - Secundaria</p>
</div> -->
</div>
<div class="item">
<img class="d-block img-fluid" src="img/header-05.jpg" alt="Slide 05">
<!-- <div class="carousel-caption">
<p>El conocimiento es libertad</p>
</div> -->
</div>
<div class="item">
<img class="d-block img-fluid" src="img/header-06.jpg" alt="Slide 06">
<!-- <div class="carousel-caption">
<p>El respeto a sí mismo</p>
</div> -->
</div>
<!-- Wrapper for slides ENDS -->
</div>
<!-- CAROUSEL ENDS -->
</div>
</header>
And a couple of screenshots:
Home page full size (index.html)
Home page small devices width
Try putting this in your CSS file
#intro {
height: auto !important;
}
This should override the default height pixel.
If you want to have the fullscreen image, then write like this
#intro {
height: 100vh !important;
}
Hope this fixes your problem.