0 votes
133 views
in HTML by (2.2k points)
edited
How do you create a 3-column card layout with different content and styles for each column?

1 Answer

0 votes
by (98.9k points)
edited

You can create a 3-column card layout by using a combination of HTML and CSS. Here's an example:

 

<div class="card-container">
  <div class="card">
    <h3>Card 1</h3>
    <p>This is the content for card 1.</p>
  </div>
  <div class="card">
    <h3>Card 2</h3>
    <p>This is the content for card 2.</p>
  </div>
  <div class="card">
    <h3>Card 3</h3>
    <p>This is the content for card 3.</p>
  </div>
</div>


 

 

.card-container {
  display: flex;
  justify-content: space-between;
}

.card {
  width: calc(33.33% - 20px);
  background-color: #f0f0f0;
  border-radius: 5px;
  padding: 20px;
}
by (98.9k points)
edited
In this example, the HTML structure consists of three individual <div> elements with the class "card" inside a container <div> with the class "card-container". The CSS code uses flexbox properties to create a 3-column layout with equal spacing between the cards.

Related questions

0 votes
1 answer 95 views
0 votes
1 answer 85 views
0 votes
1 answer 51 views
0 votes
1 answer 93 views
0 votes
1 answer 59 views
0 votes
1 answer 93 views
asked Jun 12, 2023 in HTML by radhe (2.2k points)

Doubtly is an online community for engineering students, offering:

  • Free viva questions PDFs
  • Previous year question papers (PYQs)
  • Academic doubt solutions
  • Expert-guided solutions

Get the pro version for free by logging in!

5.7k questions

5.1k answers

108 comments

537 users

...