javascript - bootstrap carousel not displaying images -
my carousel not displaying images .i have 3 images stored in folder name images.i using bootstrap 4 ,let me know wrong.i wanted know if suppose insert images below 900*500 resolution.
1-ronald.jpg of 634 * 424 then
2-messi.jpg of 594 *432 , last
3-pogba.jpg of 620 * 348 resolution
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" integrity="sha384-y3tfxazxuh4hwsyylfb+j125mxis6mr5fohampbg064zb+afewh94ndvacbm8qnd" crossorigin="anonymous"> <style type="text/css"> .carousel-inner > .carousel-item > img { padding-top:35px; margin: 0 auto; border-radius: 10px 10px 10px 10px; max-height: 500px; width: 750px; } .carousel-control.left, .carousel-control.right { background-image: none; } #carousel { margin-bottom: 50px; } </style>
<div id="carousel-example" class="carousel slide" data-ride="carousel"> <ol class="carousel-indicators"> <li data-target="#carousel-example" data-slide-to="0" class="active"></li> <li data-target="#carousel-example" data-slide-to="1"></li> <li data-target="#carousel-example" data-slide-to="2"></li> </ol> <div class="carousel-inner" role="listbox"> <div class="carousel-item active"> <img data-src="images/ronaldo1.jpg" alt="first slide"> </div> <div class="carousel-item"> <img data-src="images/pogba.jpg" alt="second slide"> </div> <div class="carousel-item"> <img data-src="images/messi.jpg" alt="third slide"> </div> </div> <a class="left carousel-control" href="#carousel-example" 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" role="button" data-slide="next"> <span class="icon-next" aria-hidden="true"></span> <span class="sr-only">next</span> </a> </div> <!-- jquery first, bootstrap js. --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.2/js/bootstrap.min.js" integrity="sha384-vz2wrjmwsjrmw/8u7i6pwi6alo1l79snbrmgidpgiwj82z8ea5lenwvxbmv1pah7" crossorigin="anonymous"></script> <script language="javascript" type="text/javascript">
in <img>
tags
<img data-src="images/pogba.jpg" alt="second slide">
change data-src
src
.
<img src="images/pogba.jpg" alt="second slide">
that way markup can find image.
data-
used storing plain data text.
check working jsfiddle.
Comments
Post a Comment