Design a Blog Post Card - Design a Blog Post Card

Tell us what’s happening:

I need help. How do i “fill the entire width of the card” using my img (step 20) and despite having a hover effect, it still says that my .read-more needs a hover effect on its element. (step 13)

Your code so far

<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Blog Post Card</title>
    <link rel="stylesheet" href="styles.css">
</head>
<body>
    <div class="blog-post-card">
        <img class="post-img" src="https://cdn.freecodecamp.org/curriculum/labs/cover-photo.jpg" alt="Cover Photo" width="160" height="100">
        <div class="post-content">
            <h2 class="post-title">My Blog Post</h2>

            <p class="post-excerpt">This is my blog post, I send blogs here and post them. Please enjoy.</p>

            <a class="read-more">Read More</a>
        </div>
    </div>

</body>
</html>
/* file: styles.css */
.blog-post-card {
  border: 2px dashed;
  border-radius: 20%;
  background-color: white;
  text-align: center;
  width: 50%;
  margin: auto;
}

.post-img {
    margin-top: 15px;
    margin-bottom: 10px; 
    width: auto;
    border-bottom: 2px dashed;
}

.post-content {
  text-align: center;
  padding: 20px;
}

.post-title {
  color: green;
}

.post-excerpt {
  color: green;
}

.read-more {
  color: purple;
  background-color: green;
  display: inline-block;
  margin: 10px;
  padding: 10px;
  border: 3px dashed;
  border-radius: 20%;
}

a:hover {background-color: black;}

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36

Challenge Information:

Design a Blog Post Card - Design a Blog Post Card

Nevermind, ive solved it!

1 Like

How did u solve the hover thing i have the same issue

hi @SCOLE-22 please create your own topic

If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Get Help > Ask for Help button located on the challenge.

The Ask for Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.

1 Like

Setting the width property to 100% solves this thing for me