How would I make the cards go left to right instead of vertical?


Helger

As the title says, I want to make the cards go left to right instead of vertical, I really don't know what to do, I've tried everything including float left

The code below is a card. They are all the same but the text is different, here is a screenshot of how it looks

.card {
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
  transition: 0.3s;
}

.card {
  box-sizing: content-box
}

.card:hover {
  box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.589);
}

.container {
  padding: 2px 16px;
}

.card {
  display: inline;
}

.card {
  float: inline-start;
}
<div class="card">
  <img src="Smash.jpg" alt="Smash" style="height:256px;width:356px">
  <section id="text">
    <div class="container">
      <h4><b>New smash bros. game.</b></h4>
      <p>Is it better than smash 4 we definitely hope so<br> Are there now too many characters?</p>
  </section>
  </div>
</div>
</div>

Jeremy Harris

Flex makes it very easy to implement. Wrap it in a container and set it flex-directionto row .

.cards {
  display: flex;
  flex-direction: row;
}
.card {
  display: flex;
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
  transition: 0.3s;
}

.card {
  box-sizing: content-box;
  margin: 10px;
}

.card:hover {
  box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.589);
}

.container {
  padding: 2px 16px;
}
<div class="cards">
  <div class="card">
    <img src="Smash.jpg" alt="Smash" style="height:256px;width:356px">
    <section id="text">
      <div class="container">
        <h4><b>New smash bros. game.</b></h4>
        <p>Is it better than smash 4 we definitely hope so<br> Are there now too many characters?</p>
      </div>
    </section>
  </div>
  <div class="card">
    <img src="Smash.jpg" alt="Smash" style="height:256px;width:356px">
    <section id="text">
      <div class="container">
        <h4><b>New smash bros. game.</b></h4>
        <p>Is it better than smash 4 we definitely hope so<br> Are there now too many characters?</p>
      </div>
    </section>
  </div>
</div>

Related


How would I make the cards go left to right instead of vertical?

Helger As the title says, I want to make the cards go left to right instead of vertical, I really don't know what to do, I've tried everything including float left The code below is a card. They are all the same but the text is different, here is a screenshot

How would I make the cards go left to right instead of vertical?

Helger As the title says, I want to make the cards go left to right instead of vertically, I really don't know what to do, I've tried everything including float left The code below is a card. They are all the same but the text is different, here is a screensho

How would I make the cards go left to right instead of vertical?

Helger As the title says, I want to make the cards go left to right instead of vertical, I really don't know what to do, I've tried everything including float left The code below is a card. They are all the same but the text is different, here is a screenshot

How would I make the cards go left to right instead of vertical?

Helger As the title says, I want to make the cards go left to right instead of vertical, I really don't know what to do, I've tried everything including float left The code below is a card. They are all the same but the text is different, here is a screenshot

How to make this slide left to right instead of

Jessica baby: Could someone show how this slide can go left to right instead of top to bottom? var current = 0, slides = document.querySelectorAll(".randtext"); setInterval(function() { for (var i = 0; i < slides.length; i++) { slides[i].style.opacity

How to make this slide left to right instead of

Jessica baby: Could someone show how this slide can go left to right instead of top to bottom? var current = 0, slides = document.querySelectorAll(".randtext"); setInterval(function() { for (var i = 0; i < slides.length; i++) { slides[i].style.opacity

How to make this slide left to right instead of

Jessica baby: Could someone show how this slide can go left to right instead of top to bottom? var current = 0, slides = document.querySelectorAll(".randtext"); setInterval(function() { for (var i = 0; i < slides.length; i++) { slides[i].style.opacity

How to make this slide left to right instead of

Jessica baby: Could someone show how this slide can go left to right instead of top to bottom? var current = 0, slides = document.querySelectorAll(".randtext"); setInterval(function() { for (var i = 0; i < slides.length; i++) { slides[i].style.opacity

How to make submenu items open left instead of right?

Shaqpad I am changing some parts of a WP site to RTL. Everything works fine except for the submenu items. When the cursor is over a menu item, obviously some submenu items are opened. Now my question is its open direction. In other words, I need to open the su

How to make submenu items open left instead of right?

Shaqpad I am changing some parts of a WP site to RTL. Everything works fine except for the submenu items. When the cursor is over a menu item, obviously some submenu items are opened. Now my question is its open direction. In other words, I need to open the su

How can I make the div go to the right?

User 12655615 I have an image in a div and I want it to go to the right. Right now it just keeps sticking to the left, overlapping another image in the div. Any idea how to do this? Himanshu Singh You can use text-align: rightalign the image to the right. .myD