0 votes
111 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

To create a 3-column card layout with different content and styles for each column, you can combine HTML and CSS as shown in the following example:

 

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

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

.card {
  width: calc(33.33% - 20px);
  background-color: #f0f0f0;
  border-radius: 5px;
  padding: 20px;
}

 

 

In this example, each card has its own unique content enclosed within the respective <div> with the class "card". You can customize the content and styles for each card by modifying the HTML and adding specific styles in CSS.

 

See the Pen Untitled by Mr Ram (@mrram) on CodePen.

 

Related questions

0 votes
1 answer 162 views
0 votes
1 answer 109 views
0 votes
1 answer 72 views
0 votes
1 answer 116 views
0 votes
1 answer 83 views
0 votes
1 answer 112 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

561 users

...