why isn't there any space between my carousel buttons? - html

I cant figure out how to make the buttons go to opposite sides of the screen
I originally thought i may have a problem with my divs, but that doesn't seem to be the problem
its probably something simple that im just over looking, but all help is appreciated.
<!--################## review section ###############-->
<section id="reviews" class="py-5">
<div id="slider" class="carousel slide " data-ride="carousel">
<div class="carousel-inner">
<!-- carousel item -->
<div class="carousel-item active">
<div class="container">
<div class="row">
<div class="col-lg-10 mx-auto d-flex justify-content-between review-item py-3">
<!-- image -->
<div class="align-self-center ml-3">
<img src="img/customer1.jpg" alt="" class="rounded-circle review-img">
</div>
<!-- text -->
<div class="review-text px-5">
<h2 class="text-capitalize mb-3 primary-color">customer name</h2>
<p class="lead text-muted">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusamus, commodi?</p>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- carousel control -->
<a href="#slider" class="carousel-control prev" role="button" data-slide="prev">
<span class="carousel-control-prev-icon"></span>
</a>
<a href="#slider" class="carousel-control next" role="button" data-slide="next">
<span class="carousel-control-next-icon"></span>
</a>
</div>
</section>
<!--################## end of review section ###############-->
i just want the buttons to be on the opposite side of the page

just a typo, per the docs carousel-control-prev not carousel-control prev
<a href="#slider" class="carousel-control-prev" role="button" data-slide="prev">
<span class="carousel-control-prev-icon"></span>
</a>
<a href="#slider" class="carousel-control-next" role="button" data-slide="next">
<span class="carousel-control-next-icon"></span>
</a>

Related

Bootstrap carousel moving to top when clicking next and before buttons?

Now I have this carousel I made with Bootstrap code:
<div id="carouselExample" class="carousel slide d-none d-sm-none d-md-block" data-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active">
<div class="row logo justify-content-center">
<div class="col">
<img class="image-logo" src="img/..." alt=""/>
</div>
<div class="col">
<img class="image-logo" src="img/..." alt=""/>
</div>
</div>
</div>
<div class="carousel-item">
<div class="row logo justify-content-center">
<div class="col">
<img class="image-logo" src="img/..." alt=""/>
</div>
<div class="col">
<img class="image-logo" src="img/..." alt=""/>
</div>
</div>
</div>
</div>
<a class="carousel-control-prev" href="#carouselExample" 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="#carouselExample" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
When I press next and prev butttons, the page moves itself to the top of the browser. How can I disable this?
Thanks!
I have the same problem on my site.
Fix:
href="#carouselExample" change to href="/#carouselExample"
try to remove
href="#carouselExample"

position img added using bootstrap

I added three images by bootstrap. but these images display in left side of page, while I want them display in center of page.
How can I do it?
this is code of images and bootstrap
<div id="carouselExampleInterval" class="carousel slide" data-ride="carousel" root="teal" >
<div class="carousel-inner">
<div class="carousel-item active" data-interval="10000">
<img src="img/pic1.jpg" class="d-block w-100" alt="..."width="1010"height="600px" >
</div>
<div class="carousel-item" data-interval="2000">
<img src="img/pic2.jpg" class="d-block w-100" alt="..."width="1010"height="600px">
</div>
<div class="carousel-item">
<img src="img/pic3.jpg" class="d-block w-100" alt="..."width="1010"height="600px">
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleInterval" 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="#carouselExampleInterval" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
According to this article, you can use bootstrap's .center-block css class to center align an image.
You would insert it into your <img> tag like so:
<img class=".center-block">

Why isn't my carousel working?

I'm trying to set up a little carousel to display some projects I've worked on. The images display but for some reason the slides don't move the carousel when I click them. Anyone know why?
I've tried messing around with a few different things, but it hasn't fixed it.
Thanks!
<div class="container" style="margin: 50px auto;">
<div>
<h4 style="margin: 1em 1em 1em 1em;">Projects</h4>
<h6>Take a quick look at some of the projects I've worked on.</h6>
<div>
<div id="myCarousel" class="carousel slide" data-ride="carousel" style="margin: 50px auto;height:350px;width:600px;">
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
</ol>
<div class="carousel-inner">
<div class="item active">
<img src="img/bg.jpg" alt="Project #1" class="carousel-item">
<div class="carousel-caption">
<h3>Example #1</h3>
<p>Description #1</p>
</div>
</div>
<div class="item">
<img src="img/bg.jpg" alt="Project #2" class="carousel-item">
<div class="carousel-caption">
<h3>Example #2</h3>
<p>Description #2!</p>
</div>
</div>
<div class="item">
<img src="img/bg.jpg" alt="Project #3" class="carousel-item">
<div class="carousel-caption">
<h3>Example #3</h3>
<p>Description #3</p>
</div>
</div>
</div>
<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>
</div>
Try adding this instead of yours :
<a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
Make sure that the href to the js and css files of the carousel is right.
and add this at 1st in the <head> section:
<script>
// Load this when the DOM is ready
$(function () {
// You used .myCarousel here.
// That's the class selector not the id selector,
// which is #myCarousel
$('#myCarousel').carousel();
});
</script>
Hope this is helpful :)

Bootstrap Carousel - Controls only work for the first carousel

I am developing a website for a Real Estate company and I am having problems with Bootstrap's Carousel controls.
My goal is to have a row with three different columns and a Carousel in each column. I get this to work, the problem is that when I get the 3 carousels in their corresponding columns, the controls of the Carousel no.2 and the Carousel no.3 activate the Carousel no.1 and not the Carousel where they belong.
Here is my code:
<div class="row">
<div class="col-md-4">
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="http://lorempixel.com/400/400/" alt="...">
</div>
<div class="item">
<img src="https://dummyimage.com/400x400/000/fff" alt="...">
</div>
</div>
<!-- Controls -->
<a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>
<!--FIRST COLUMN FINISHES HERE-->
<!--SECOND COLUMN STARTS HERE-->
<div class="col-md-4">
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="http://lorempixel.com/400/400/" alt="...">
</div>
<div class="item">
<img src="https://dummyimage.com/400x400/000/fff" alt="...">
</div>
</div>
<!-- Controls -->
<a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>
<!--SECOND COLUMN FINISHES HERE-->
<!--THIRD COLUMN STARTS HERE-->
<div class="col-md-4">
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="http://lorempixel.com/400/400/" alt="...">
</div>
<div class="item">
<img src="https://dummyimage.com/400x400/000/fff" alt="...">
</div>
</div>
<!-- Controls -->
<a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>
Do you guys know why this is happening? What do I have to do to make the controls activate their own carousel and not Carousel number 1?
I hope I was clear and somewhat easy to understand. Thank you in advance for your help.
Because you have used the same IDs for all the three carousels. And by default only the first ID element on the DOM would be selected (First Slider in your case).
Try updating your code like this -
<a class="left carousel-control" href="#carousel-one" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#carousel-one" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
Similarly, please update the ID from carousel-example-generic to carousel-one carousel-two and carousel-three respectively for your three carousels. And also update the href as I did in the code above.
Please let me know if the problem still persist.
All your carousels have same id. Put them unique id and also change in controls with new id's. th

Footer ain't at the bottom

I'm trying to get my footer to the bottom of page.
When I create a fiddle it works; https://jsfiddle.net/3dd73cuk/
But on my page it´s "flying"; http://bjornc.se/sites/torhultsbrunn/
I guess bootstrap has some default behavior that messes it up?!
Code
<style>
.footer{
background-image: url("img/grassTop.png");
background-size: 100%;
position: fixed;
bottom: 0;
width: 100%;
height: 150px;
}
</style>
</head>
<body>
<!-- Navigation -->
<nav class="navbar navbar-fixed-top" role="navigation">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Torhults Brunn.se</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li>
Om oss
</li>
<li>
Våra tjänster
</li>
<li>
Kontakt
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</nav>
<!-- Page Content -->
<div class="container">
<div class="row">
<div class="col-md-3">
<p class="lead">Trädgårdsmöbler</p>
<div class="list-group">
Trämöbler
Metallmöbler
Konstrottingmöbler
Parasoll & Övrigt
Dynor
</div>
</div>
<div class="col-md-9">
<div class="row carousel-holder">
<div class="col-md-12">
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
<li data-target="#carousel-example-generic" data-slide-to="1"></li>
<li data-target="#carousel-example-generic" data-slide-to="2"></li>
<li data-target="#carousel-example-generic" data-slide-to="3"></li>
<li data-target="#carousel-example-generic" data-slide-to="4"></li>
<li data-target="#carousel-example-generic" data-slide-to="5"></li>
<li data-target="#carousel-example-generic" data-slide-to="6"></li>
<li data-target="#carousel-example-generic" data-slide-to="7"></li>
</ol>
<div class="carousel-inner">
<div class="item active">
<img class="slide-image" src="img/carousel/drommingeSoffa.png" style="height: 300px" alt=""/>
</div>
<div class="item">
<img class="slide-image" src="img/carousel/durbanKonstRottingGrupp.png" style="height: 300px" alt=""/>
</div>
<div class="item">
<img class="slide-image" src="img/carousel/nydalaGrupp.png" style="height: 300px" alt=""/>
</div>
<div class="item">
<img class="slide-image" src="img/carousel/shabbyGrupp.png" style="height: 300px" alt=""/>
</div>
<div class="item">
<img class="slide-image" src="img/carousel/sodertorpSoffaByggbar.png" style="height: 300px" alt=""/>
</div>
<div class="item">
<img class="slide-image" src="img/carousel/tannoHammock.png" style="height: 300px" alt=""/>
</div>
<div class="item">
<img class="slide-image" src="img/carousel/torpetTradgardsgrupp.png" style="height: 300px" alt=""/>
</div>
</div>
<a class="left carousel-control" href="#carousel-example-generic" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
</a>
<a class="right carousel-control" href="#carousel-example-generic" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
</a>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-4 col-lg-4 col-md-4">
<div class="thumbnail">
<img src="http://placehold.it/320x150" alt="">
<div class="caption">
<h4 class="pull-right">$24.99</h4>
<h4>First Product
</h4>
<p>See more snippets like this online store item at <a target="_blank" href="http://www.bootsnipp.com">Bootsnipp - http://bootsnipp.com</a>.</p>
</div>
<div class="ratings">
<p class="pull-right">15 reviews</p>
<p>
<span class="glyphicon glyphicon-star"></span>
<span class="glyphicon glyphicon-star"></span>
<span class="glyphicon glyphicon-star"></span>
<span class="glyphicon glyphicon-star"></span>
<span class="glyphicon glyphicon-star"></span>
</p>
</div>
</div>
</div>
<div class="col-sm-4 col-lg-4 col-md-4">
<div class="thumbnail">
<img src="http://placehold.it/320x150" alt="">
<div class="caption">
<h4 class="pull-right">$64.99</h4>
<h4>Second Product
</h4>
<p>This is a short description. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
</div>
<div class="ratings">
<p class="pull-right">12 reviews</p>
<p>
<span class="glyphicon glyphicon-star"></span>
<span class="glyphicon glyphicon-star"></span>
<span class="glyphicon glyphicon-star"></span>
<span class="glyphicon glyphicon-star"></span>
<span class="glyphicon glyphicon-star-empty"></span>
</p>
</div>
</div>
</div>
<div class="col-sm-4 col-lg-4 col-md-4">
<div class="thumbnail">
<img src="http://placehold.it/320x150" alt="">
<div class="caption">
<h4 class="pull-right">$74.99</h4>
<h4>Third Product
</h4>
<p>This is a short description. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
</div>
<div class="ratings">
<p class="pull-right">31 reviews</p>
<p>
<span class="glyphicon glyphicon-star"></span>
<span class="glyphicon glyphicon-star"></span>
<span class="glyphicon glyphicon-star"></span>
<span class="glyphicon glyphicon-star"></span>
<span class="glyphicon glyphicon-star-empty"></span>
</p>
</div>
</div>
</div>
<div class="col-sm-4 col-lg-4 col-md-4">
<div class="thumbnail">
<img src="http://placehold.it/320x150" alt="">
<div class="caption">
<h4 class="pull-right">$84.99</h4>
<h4>Fourth Product
</h4>
<p>This is a short description. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
</div>
<div class="ratings">
<p class="pull-right">6 reviews</p>
<p>
<span class="glyphicon glyphicon-star"></span>
<span class="glyphicon glyphicon-star"></span>
<span class="glyphicon glyphicon-star"></span>
<span class="glyphicon glyphicon-star-empty"></span>
<span class="glyphicon glyphicon-star-empty"></span>
</p>
</div>
</div>
</div>
<div class="col-sm-4 col-lg-4 col-md-4">
<div class="thumbnail">
<img src="http://placehold.it/320x150" alt="">
<div class="caption">
<h4 class="pull-right">$94.99</h4>
<h4>Fifth Product
</h4>
<p>This is a short description. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
</div>
<div class="ratings">
<p class="pull-right">18 reviews</p>
<p>
<span class="glyphicon glyphicon-star"></span>
<span class="glyphicon glyphicon-star"></span>
<span class="glyphicon glyphicon-star"></span>
<span class="glyphicon glyphicon-star"></span>
<span class="glyphicon glyphicon-star-empty"></span>
</p>
</div>
</div>
</div>
<div class="col-sm-4 col-lg-4 col-md-4">
<h4>Like this template?
</h4>
<p>If you like this template, then check out <a target="_blank" href="http://maxoffsky.com/code-blog/laravel-shop-tutorial-1-building-a-review-system/">this tutorial</a> on how to build a working review system for your online store!</p>
<a class="btn btn-primary" target="_blank" href="http://maxoffsky.com/code-blog/laravel-shop-tutorial-1-building-a-review-system/">View Tutorial</a>
</div>
</div>
</div>
</div>
</div>
<!-- /.container -->
<hr>
<!-- Footer -->
<footer class="footer">
<div class="col-lg-12">
<p>Copyright © Torhultsbrunn 2015</p>
</div>
</footer>
<!-- jQuery -->
<script src="js/jquery.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="js/bootstrap.min.js"></script>
</body>
In your shop-homepage.css you have this:
margin: 50px 0;
That's what's causing it to "fly" since it's applying a margin to it which forces it up, even though you have bottom: 0; present, but since you are including the shop-homepage.css afer your bootstrap.min.css it's overwriting the previous .footer.
Simply change it to:
margin: 0px 0;