menu search
brightness_auto
more_vert
How do you create a card with HTML and CSS?
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike

1 Answer

more_vert
 
verified
Best answer
<div class="card">
  <img src="image.jpg" alt="Card Image">
  <div class="card-content">
    <h3>Title</h3>
    <p>Card content goes here.</p>
    <a href="#" class="button">Read More</a>
  </div>
</div>

 

.card {
  width: 300px;
  background-color: #f0f0f0;
  border-radius: 5px;
  padding: 20px;
}

.card img {
  width: 100%;
}

.card-content {
  margin-top: 10px;
}

.button {
  background-color: #333;
  color: #fff;
  padding: 8px 16px;
  text-decoration: none;
}

 

 

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

thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike

Related questions

thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike
1 answer
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike
1 answer
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike
1 answer
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike
1 answer
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike
1 answer
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike
1 answer

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

648 users

...