How to make a text-only slide in bootstrap

Asked

Viewed 251 times

0

I would like this element to become a slider, but I just want the text and the image like this, I can’t do it inserir a descrição da imagem aqui

You’re getting like this: inserir a descrição da imagem aqui

CSS

.carousel-title{
  margin-top: 1%;
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 20px;
  color: #f8f8f8;
  transition: color .26s ease-in-out;
}
.carousel-text{
  margin-top: 2%;
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 15px;
  color: #f8f8f8;
  transition: color .26s ease-in-out;
  text-align: justify;
}
.product-slide{
background: url(../image/background-page.png);
background-position: center;
background-repeat: no-repeat;
background-size: cover;
padding: 20px 0px;
  }
  <!DOCTYPE html>
<html lang="en" >
<head>
  <meta charset="UTF-8">
  <title>CodePen - Overlay menu</title>
  <link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css'>
  <link rel="stylesheet" href="assets/menu.css">
  <link rel="stylesheet" type="text/css" href="assets/style.css">
  <link href="https://fonts.googleapis.com/css?family=Pacifico|Source+Sans+Pro:200i&display=swap" rel="stylesheet">
</head>

  • The Bootstrap already has a component ready for you to use, just take the official documentation https://getbootstrap.com/docs/4.0/components/carousel/ I could not understand its right

  • Yeah, I know, but I wanted the slide to pass just like I put it in the print, no big pictures, I wanted the slide to show Row, you know? Small image on the side of the text, that’s it.

  • Guy just put a Row/col inside the structure of the Slidar, inside the Slide 1 you put a Row and two col... For what you say your problem is not the slider, but how to put an image on the left side and a testo on the right side, for that you can use the class pull-left in the image...

  • I even managed but another problem appeared https://prnt.sc/rc3tap , it is not like the image of the topic itself

  • I redid the topic explaining better and with the new code

1 answer

0


Just follow the standard Bootstrap getbootstrap.com/Docs/4.0/Components/Carousel code and place an image and text inside the <div class="carousel-item"> and in the image you put the class float-left for it to be left of the text

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8" />
  <title>Page Title</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" type="text/css" media="screen" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.8.2/css/all.min.css" />
  <link rel="stylesheet" type="text/css" media="screen" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" />
<style>
  
</style>
</head>
<body class="bg-primary">
  
  <div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
    <ol class="carousel-indicators">
      <li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
      <li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
      <li data-target="#carouselExampleIndicators" data-slide-to="2"></li>
    </ol>
    <div class="carousel-inner">
      <div class="carousel-item active">
        <img class="float-left mr-4" src="https://unsplash.it/50/200" alt="First slide">
        <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Ipsam iste amet alias maxime molestias provident ducimus perferendis dignissimos corrupti! Possimus, quasi! Sequi rerum asperiores tempore, consequatur at aperiam molestias in?</p>
      </div>
      <div class="carousel-item">
        <img class="float-left mr-4" src="https://unsplash.it/55/200" alt="First slide">
        <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Ipsam iste amet alias maxime molestias provident ducimus perferendis dignissimos corrupti! Possimus, quasi! Sequi rerum asperiores tempore, consequatur at aperiam molestias in?</p>
      </div>
      <div class="carousel-item">
        <img class="float-left mr-4" src="https://unsplash.it/60/200" alt="First slide">
        <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Ipsam iste amet alias maxime molestias provident ducimus perferendis dignissimos corrupti! Possimus, quasi! Sequi rerum asperiores tempore, consequatur at aperiam molestias in?</p>
      </div>
    </div>
    <a class="carousel-control-prev" href="#carouselExampleIndicators" 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="#carouselExampleIndicators" role="button" data-slide="next">
      <span class="carousel-control-next-icon" aria-hidden="true"></span>
      <span class="sr-only">Next</span>
    </a>
  </div>
  
  <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
  <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js"></script>
</body>
</html>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.