title: How display two div horizontally in my carousel?
body: <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>/*slides show*/
  
  var slideIndex = 0;
  showSlides();
  
  function showSlides() {
      var i;
      var slides = document.getElementsByClassName("mySlides");
      var dots = document.getElementsByClassName("dot");
      for (i = 0; i &lt; slides.length; i++) {
         slides[i].style.display = "none";  
      }
      slideIndex++;
      if (slideIndex &gt; slides.length) {slideIndex = 1}    
      for (i = 0; i &lt; dots.length; i++) {
          dots[i].className = dots[i].className.replace(" active", "");
      }
      slides[slideIndex-1].style.display = "flex";  
      dots[slideIndex-1].className += " active";
      setTimeout(showSlides, 5000); // Change image every 2 seconds
  }
  
  
  /*End slides show*/</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>img {vertical-align: middle;}
  
  /* Slideshow container */
  
      .mySlides{
          display: flex;
          flex-direction: row;
          width: 75vw;
          border: 1px solid red;
      }
      .mySlides &gt; div {
          flex: 0 0 50%;
          border: 1px solid green;
      }
  
  
  .slideshow-container {
    max-width: 1000px;
    position: relative;
    margin: auto;
    margin-top: 50px;
  
  }
  
  
  /* Caption text */
  .text {
    color: #f2f2f2;
    font-size: 15px;
    padding: 8px 12px;
        box-sizing: border-box;
  
  
  }
  
  /* Number text (1/3 etc) */
  .numbertext {
    color: #f2f2f2;
    font-size: 12px;
    padding: 8px 12px;
  
  }
  
  /* The dots/bullets/indicators */
  .dot {
    height: 5px;
    width: 5px;
    margin: 0 2px;
    background-color: #bbb;
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.6s ease;
  }
  
  .active {
    background-color: #717171;
  }
  
  /* Fading animation */
  .fade {
    -webkit-animation-name: fade;
    -webkit-animation-duration: 1.5s;
    animation-name: fade;
    animation-duration: 1.5s;
  }
  
  @-webkit-keyframes fade {
    from {opacity: .4} 
    to {opacity: 1}
  }
  
  @keyframes fade {
    from {opacity: .4} 
    to {opacity: 1}
  }
  
  /* On smaller screens, decrease text size */
  @media only screen and (max-width: 300px) {
    .text {font-size: 11px}
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;body&gt;
       &lt;div id="header" class="navbar"&gt;
    &lt;div id="Title"&gt;
      &lt;a href="Accueil"&gt;&lt;img src="IMAGES/PNG/logo.png" alt="logo" /&gt;&lt;/a&gt;
    &lt;/div&gt;
    &lt;div id="navbar"&gt;
      &lt;div class="menu"&gt; &lt;a class="active" href="javascript:void(0)"&gt;Blog&lt;/a&gt;&lt;/div&gt;
      &lt;div class="menu"&gt; &lt;a href="blog"&gt;Contact&lt;/a&gt;&lt;/div&gt;
      &lt;div class="menu"&gt; &lt;a href="blog"&gt;L'électrophotonique&lt;/a&gt;&lt;/div&gt;
      &lt;div class="menu"&gt; &lt;a href="blog"&gt;Qui sommes nous?&lt;/a&gt;&lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  
  
    &lt;div class="slideshow-container"&gt;
  
    &lt;div id = "slideshow" class="mySlides fade"&gt;
      &lt;div&gt;&lt;img src="IMAGES/PNG/background.png"&gt;&lt;/div&gt;
       &lt;div class="text"&gt; test1 &lt;/div&gt;
     &lt;/div&gt;
  
  
    &lt;div class="mySlides fade"&gt;
      &lt;img src="IMAGES/PNG/eau59h.png"&gt;
      &lt;div class="text"&gt;test 2&lt;/div&gt;
    &lt;/div&gt;
  
    &lt;div class="mySlides fade"&gt;
      &lt;img src="IMAGES/PNG/pont.png"&gt;
      &lt;div class="text"&gt;test 3&lt;/div&gt;
    &lt;/div&gt;
  
    &lt;/div&gt;
    &lt;br&gt;
  
    &lt;div style="text-align:center"&gt;
      &lt;span class="dot"&gt;&lt;/span&gt; 
      &lt;span class="dot"&gt;&lt;/span&gt; 
      &lt;span class="dot"&gt;&lt;/span&gt; 
    &lt;/div&gt;
  
  
  
  
    &lt;div class="content" &gt;
  
  
  
  &lt;script type="text/javascript" src="JS/sticky_navbar.js"&gt;&lt;/script&gt;
  &lt;script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js'&gt;&lt;/script&gt;
  &lt;script  src="js/index.js"&gt;&lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I'm trying to display 2 divs in 1 row in my slide show ? 
  One part is an image and the second is the legend and text. </p>
  
  <p>I'm trying to use flexbox to do it but it doesn't work and I don't understand why. </p>
  
  <p>I introduce a div with an ID (slideshow) for test but the div with the image and the the div class = "text" are still align vertically </p>
  
  <p>Can you help me? </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>/*slides show*/
  
  var slideIndex = 0;
  showSlides();
  
  function showSlides() {
      var i;
      var slides = document.getElementsByClassName("mySlides");
      var dots = document.getElementsByClassName("dot");
      for (i = 0; i &lt; slides.length; i++) {
         slides[i].style.display = "none";  
      }
      slideIndex++;
      if (slideIndex &gt; slides.length) {slideIndex = 1}    
      for (i = 0; i &lt; dots.length; i++) {
          dots[i].className = dots[i].className.replace(" active", "");
      }
      slides[slideIndex-1].style.display = "block";  
      dots[slideIndex-1].className += " active";
      setTimeout(showSlides, 5000); // Change image every 2 seconds
  }
  
  
  /*End slides show*/</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>@charset "UTF-8";
  /* CSS Document */
  body {
    margin: 0;
    font-size: 28px;
    background-color: #00011f;
    display: flex;
    flex-direction: column;
    margin : auto;
  }
  
  
  img {vertical-align: middle;}
  
  /* Slideshow container */
  
  #slideshow{
  float: flex;}
  
  
  .slideshow-container {
    max-width: 1000px;
    position: relative;
    margin: auto;
    margin-top: 50px;
  
  }
  
  
  /* Caption text */
  .text {
    color: #f2f2f2;
    font-size: 15px;
    padding: 8px 12px;
    position: absolute;
    bottom: 8px;
    width: 100%;
    text-align: center;
  }
  
  /* Number text (1/3 etc) */
  .numbertext {
    color: #f2f2f2;
    font-size: 12px;
    padding: 8px 12px;
    position: absolute;
    top: 0;
  }
  
  /* The dots/bullets/indicators */
  .dot {
    height: 5px;
    width: 5px;
    margin: 0 2px;
    background-color: #bbb;
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.6s ease;
  }
  
  .active {
    background-color: #717171;
  }
  
  /* Fading animation */
  .fade {
    -webkit-animation-name: fade;
    -webkit-animation-duration: 1.5s;
    animation-name: fade;
    animation-duration: 1.5s;
  }
  
  @-webkit-keyframes fade {
    from {opacity: .4} 
    to {opacity: 1}
  }
  
  @keyframes fade {
    from {opacity: .4} 
    to {opacity: 1}
  }
  
  /* On smaller screens */
  @media only screen and (max-width: 300px) {
    .text {font-size: 11px}
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  
   &lt;link rel="stylesheet" href="CSS/style2.css" /&gt;
   &lt;link rel="shortcut icon" href="IMAGES/PNG/favicon.png" /&gt;
  
      &lt;head&gt;
          &lt;meta charset="utf-8" /&gt;
          &lt;title&gt;Electrophotonique Ingenierie&lt;/title&gt;
          &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
  
  
      &lt;/head&gt;
  
  
      &lt;body&gt;
       
    &lt;div class="slideshow-container"&gt;
  
    &lt;div id = "slideshow" class="mySlides fade"&gt;
      &lt;div&gt;&lt;img src="IMAGES/PNG/background.png"&gt;&lt;/div&gt;
      &lt;div class="text"&gt; testtesttesttesttesttesttesttesttesttesttesttest &lt;/div&gt;
     &lt;/div&gt;
  
  
    &lt;div class="mySlides fade"&gt;
      &lt;img src="IMAGES/PNG/eau59h.png" style="width:100%"&gt;
      &lt;div class="text"&gt;&lt;/div&gt;
    &lt;/div&gt;
  
    &lt;div class="mySlides fade"&gt;
      &lt;img src="IMAGES/PNG/pont.png" style="width:100%"&gt;
      &lt;div class="text"&gt;&lt;/div&gt;
    &lt;/div&gt;
  
    &lt;/div&gt;
    &lt;br&gt;
  
    &lt;div style="text-align:center"&gt;
      &lt;span class="dot"&gt;&lt;/span&gt; 
      &lt;span class="dot"&gt;&lt;/span&gt; 
      &lt;span class="dot"&gt;&lt;/span&gt; 
    &lt;/div&gt;
  
  
    &lt;div class="content" &gt;&lt;/div&gt;
  
  &lt;script type="text/javascript" src="JS/sticky_navbar.js"&gt;&lt;/script&gt;
  &lt;script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js'&gt;&lt;/script&gt;
  &lt;script  src="js/index.js"&gt;&lt;/script&gt;
  
  
  
  
  
  
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><a href="https://i.stack.imgur.com/m7Sk9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/m7Sk9.png" alt="with the code edited"></a></p>