Layout messed up in bootstrap - html

I wrote a simple web page for experiment:
Here is the code:
<!doctype html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="./css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="./css/bootstrap-theme.min.css">
</head>
<body>
<div class="container">
<div class="row">
<nav class="navbar navbar-default">
<!-- <div class="navbar-header"></div> -->
<center>Menu Bar!</center>
</nav>
</div>
<div class="carousel slide" data-ride="carousel">
<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>
<li data-target="#myCarousel" data-slide-to="3"></li>
</ol>
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="./imgs/index.jpeg" alt="Chania">
</div>
<div class="item">
<img src="./imgs/index1.jpeg" alt="Chania">
</div>
<div class="item">
<img src="./imgs/index2.jpeg" alt="Flower">
</div>
<div class="item">
<img src="./imgs/index3.jpeg" alt="Flower">
</div>
</div>
<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>
</div>
<div class="container">
<div class="row">
<div class="col-xs-4">
<div class="well"></div>
</div>
<div class="col-xs-4">
<div class="well"></div>
</div>
<div class="col-xs-4">
<div class="well"></div>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="well"></div>
</div>
</div>
<nav class="footer">
<nav class="container">
Footer!!
</nav>
</nav>
</body>
</html>
And the web page is like this:
Footer isn't coming up properly. Carousel isn't working properly. But the page is responsive and loads properly in various screens. How can I fix it?

Ensure that your images are something that can be found. By appearance alone it seems that your code was able to find index.jpeg but not any of the others. Try using index.jpeg all 4 times and see if that helps.
<div class="item active">
<img src="./imgs/index.jpeg" alt="Chania">
</div>
<div class="item">
<img src="./imgs/index.jpeg" alt="Chania">
</div>
<div class="item">
<img src="./imgs/index.jpeg" alt="Flower">
</div>
<div class="item">
<img src="./imgs/index.jpeg" alt="Flower">
</div>

Related

Google sites problem- HTML (don't show PIC )

I have a problem that when I copied the codes from w3schools websites (https://www.w3schools.com/bootstrap/tryit.asp?filename=trybs_carousel2&stacked=h)
and I use it for Google sites as a tool , but when I but the codes the images don't showed up as you see in the Pic below
please see my problem.
As you can see the below code, they use for img src "la.jpg" that's why you can't see the picture. If you replace it with "https://www.w3schools.com/bootstrap/{image_name}.jpg" for img src code, I think you can see the pics.
<div class="container">
<h2>Carousel Example</h2>
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<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>
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item active">
<img src="la.jpg" alt="Los Angeles" style="width:100%;">
<div class="carousel-caption">
<h3>Los Angeles</h3>
<p>LA is always so much fun!</p>
</div>
</div>
<div class="item">
<img src="chicago.jpg" alt="Chicago" style="width:100%;">
<div class="carousel-caption">
<h3>Chicago</h3>
<p>Thank you, Chicago!</p>
</div>
</div>
<div class="item">
<img src="ny.jpg" alt="New York" style="width:100%;">
<div class="carousel-caption">
<h3>New York</h3>
<p>We love the Big Apple!</p>
</div>
</div>
</div>
<!-- Left and right controls -->
<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>
</body>
</html>
You can see the edited version below. Please check the differences.
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<h2>Carousel Example</h2>
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<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>
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item active">
<img src="https://www.w3schools.com/bootstrap/la.jpg" alt="Los Angeles" style="width:100%;">
<div class="carousel-caption">
<h3>Los Angeles</h3>
<p>LA is always so much fun!</p>
</div>
</div>
<div class="item">
<img src="https://www.w3schools.com/bootstrap/chicago.jpg" alt="Chicago" style="width:100%;">
<div class="carousel-caption">
<h3>Chicago</h3>
<p>Thank you, Chicago!</p>
</div>
</div>
<div class="item">
<img src="https://www.w3schools.com/bootstrap/ny.jpg" alt="New York" style="width:100%;">
<div class="carousel-caption">
<h3>New York</h3>
<p>We love the Big Apple!</p>
</div>
</div>
</div>
<!-- Left and right controls -->
<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>
</body>
</html>

boostrap carousel not working/images are just being displayed on atop the other

So,i'm new to this ,the bootstrap carousel isn't working for me,I took the example straight from w3school and it's still not working it only displays the images one atop of the other,admittedly this is a rushed job ,so I may have missed something blindingly obvious.Not to mention my coding knowledge is really patchy,my code:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Pagrindinis puslapis</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#"></a>//logotipas
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav">
<li class="active">Pagrindinis</li>
<li>Visos prekės</li>
<li>Populiariausios prekės</li>
<li>Nuolaidos</li>
<li>Pristatymas</li>
<li>Kontaktai</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><span class="glyphicon glyphicon-log-in"></span> Prisijungimas/Užsisakymas</li>
</ul>
</div>
</div>
</nav>
<div id="demo" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ul class="carousel-indicators">
<li data-target="#demo" data-slide-to="0" class="active"></li>
<li data-target="#demo" data-slide-to="1"></li>
<li data-target="#demo" data-slide-to="2"></li>
</ul>
<!-- The slideshow -->
<div class="carousel-inner">
<div class="carousel-item active">
<img src="bob.jpg" alt="Los Angeles" width="1100" height="500">
</div>
<div class="carousel-item">
<img src="young.jpg" alt="Chicago" width="1100" height="500">
</div>
<div class="carousel-item">
<img src="thing.jpg" alt="New York" width="1100" height="500">
</div>
</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>
<footer class="container-fluid text-center">
<p>Footer Text</p>
</footer>
</body>
</html>
I think the problem is with the carousel-item class. Replace it with with item class.
You need to replace carousel-item with item for bootstrap 3 carousels.
Here's the code
<!-- The slideshow -->
<div class="carousel-inner">
<div class="item active">
<img src="http://via.placeholder.com/1100x500" alt="Los Angeles" width="1100" height="500">
</div>
<div class="item">
<img src="http://via.placeholder.com/1100x500" alt="Chicago" width="1100" height="500">
</div>
<div class="item">
<img src="http://via.placeholder.com/1100x500" alt="New York" width="1100" height="500">
</div>
</div>

Bootstrap 4 carousel not working?

I have the following BS4 Carousel code, (made it using this tutorial https://www.youtube.com/watch?v=n8ItscKLf7s&list=PLRtjMdoYXLf47brThg9-nTj8HSq8cQ0ND&index=53), However the code is not working, the first image is displayed but I dont know for what reasons carousel is not controlled and it does'nt go to the next image in any case. What is the possible solution?
<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12">
<br />
<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>
</ol>
<div class="carousel-inner" role="listbox">
<div class="carousel-item-active">
<img src="images/1.jpeg" alt="First-Slide">
</div>
<div class="carousel-item">
<img src="images/2.jpeg" alt="Second-Slide">
</div>
<div class="carousel-item">
<img src="images/3.jpeg" alt="Third-Slide">
</div>
</div>
<a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
<span class="icon-prev" 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="icon-next" aria-hidden="true"></span>
<span class="sr-only"> Next </span>
</a>
</div>
</div>
</div>
</div>
Works perfectly
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<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>
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item active">
<img src="https://www.w3schools.com/bootstrap/ny.jpg" alt="Los Angeles" style="width:100%;">
</div>
<div class="item">
<img src="https://www.w3schools.com/bootstrap/chicago.jpg" alt="Chicago" style="width:100%;">
</div>
<div class="item">
<img src="https://www.w3schools.com/bootstrap/newyork.jpg" alt="New york" style="width:100%;">
</div>
</div>
<!-- Left and right controls -->
<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>
</body>
</html>
Small mistake. class="carousel-item-active" should be class="carousel-item active". It is not a single class. You have combined the active class with carousel-item class. That is the mistake.
<div class="carousel-item-active">
<img src="images/1.jpeg" alt="First-Slide">
</div>
Should changed to
<div class="carousel-item active">
<img src="images/1.jpeg" alt="First-Slide">
</div>

HTML carousel using text over a static image

(new to this)
I'm trying to get a static image with a carousel of different text going across the top. I've tried using the Bootstrap carousel HTML and removing sections (such as the multiple images), and using the "carousel-caption" class for my text, but that will take some styling to get it centered etc. This might be the best way, but if there is a simpler way, please let me know! (its in a jumbotron div as i was using a picture from my jumbotron section for ease)
TIA
<div class="jumbotron" id="testimonials">
<div class="container">
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<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>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<div class="carousel-text">
<h3>Example headline</h3>
<p>Example description</p>
</div>
<!-- <img src="img/lesson8-portfolioheroimage2.jpg" alt="..."> -->
</div>
<div class="item">
<!-- <img src="img/portfolioheroimage.jpg" alt="..."> -->
<div class="carousel-text">
<h3>Example head</h3>
<p>Example description</p>
</div>
</div>
<div class="item">
<!-- <img src="img/portfolioheroimage3.jpg" alt="..."> -->
<div class="carousel-text">
<h3>Example headline</h3>
<p>Example descri</p>
</div>
</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><!-- container -->
</div><!-- jumbotron -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<div class="jumbotron">
<div class="container">
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<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>
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item active">
<div class="carousel-text">
<h3>Example headline</h3>
<p>Example description</p>
</div>
<!-- <img src="img/lesson8-portfolioheroimage2.jpg" alt="..."> -->
</div>
<div class="item">
<!-- <img src="img/portfolioheroimage.jpg" alt="..."> -->
<div class="carousel-text">
<h3>Example head</h3>
<p>Example description</p>
</div>
</div>
<div class="item">
<!-- <img src="img/portfolioheroimage3.jpg" alt="..."> -->
<div class="carousel-text">
<h3>Example headline</h3>
<p>Example descri</p>
</div>
</div>
</div>
<!-- Left and right controls -->
<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>
You need something like this I guess?
You can beautify it as per your requirement.

Why is twitter bootstrap carousel class "slide" unknown in bootsrap 3

I have downloaded the twitter bootsrap carousel example. I noticed that when I navigate the slide nothing happens and in my view the "slide" class from the bootstrap.css version 3 is unknown.
Based on the head section below I believe I have all the necessary js and css files.
I have 2 questions. Why is the the "slide" class unknown and should the carousel be navigable straight out of the box?
<head>
<link href ="/Content/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href ="/Content/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="/Content/bootstrap/js-twitter-bootstrap/bootstrap-dropdown.js"></script>
<script data-main="/Scripts/main" src="~/Scripts/require.min.js"></script>
<script src="/Content/bootstrap/js/bootstrap.min.js"></script>
</head>
<div id="carousel-example-generic" class="carousel slide">
<!-- Indicators -->
<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>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item active">
<img src="http://placehold.it/1200x480" alt="" />
<div class="carousel-caption">
...
</div>
</div>
...
</div>
<!-- Controls -->
<a class="left carousel-control" href="#carousel-example-generic" data-slide="prev">
<span class="icon-prev"></span>
</a>
<a class="right carousel-control" href="#carousel-example-generic" data-slide="next">
<span class="icon-next"></span>
</a>
</div
Here is a working code for carousel,
<!DOCTYPE html>
<html lang="en">
<head>
<link href="../../dist/css/bootstrap.css" rel="stylesheet">
<link href="carousel.css" rel="stylesheet">
</head>
<body>
<div class="container">
<div id="myCarousel" class="carousel slide">
<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="data:image/png;base64," data-src="holder.js/100%x500/auto/#777:#7a7a7a/text:First slide" alt="First slide">
<div class="container">
<div class="carousel-caption">
<h1>Slide 1.</h1>
<p><a class="btn btn-large btn-primary" href="#">Sign up today</a></p>
</div>
</div>
</div>
<div class="item">
<img src="data:image/png;base64," data-src="holder.js/100%x500/auto/#777:#7a7a7a/text:Second slide" alt="Second slide">
<div class="container">
<div class="carousel-caption">
<h1>Slide 2</h1>
<p><a class="btn btn-large btn-primary" href="#">Learn more</a></p>
</div>
</div>
</div>
<div class="item">
<img src="data:image/png;base64," data-src="holder.js/100%x500/auto/#777:#7a7a7a/text:Third slide" alt="Third slide">
<div class="container">
<div class="carousel-caption">
<h1>Slide 3</h1>
<p><a class="btn btn-large btn-primary" href="#">Browse gallery</a></p>
</div>
</div>
</div>
</div>
<a class="left carousel-control" href="#myCarousel" data-slide="prev"><span class="glyphicon glyphicon-chevron-left"></span></a>
<a class="right carousel-control" href="#myCarousel" data-slide="next"><span class="glyphicon glyphicon-chevron-right"></span></a>
<script src="../../assets/js/jquery.js"></script>
<script src="../../dist/js/bootstrap.min.js"></script>
<script src="../../assets/js/holder.js"></script>