Design a Blog Post Card - Design a Blog Post Card

Tell us what’s happening:

line 13. Your .read-more element should have a hover effect.

code does not pass even though I have hover effect on Read More.
Can someone please help. Below is my code.

.read-more:hover {
background-color: pink;
}

Thanks

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="image of laptop">
<div class="post-content">
    <h2 class="post-title">Learn Web Development in 2024</h2>
    <p class="post-excerpt">Stay ahead of the curve with the latest trends in web development. Discover what's new and exciting in 2024</p>
    <a class="read-more" href="#read-more">Read More</a>
</div>
</div>
</body>
</html>
/* file: styles.css */
.read-more {
display: inline-block;
background-color: black;
color: white;
margin: auto;
padding: auto;
border-radius: 5px;
padding: 5px;
text-decoration: none;
}
a.read-more:hover {
background-color:pink;
}
.blog-post-card {

    margin: auto;
    width: 65%;
    border: 3px solid whitesmoke;
    background-color: white;
    border-radius: 10px;
    text-align: center;
}
.post-img {
    width: 100%;
    border-bottom: 1rem solid white;
}
.post-content {
  padding: 5px;
}
.read-more {
  margin: 10px;
}
.post-title{
  color: blue;
  margin: 5px;
}
.post-excerpt{
  color: blue;
  margin: 5px;
}

Your browser information:

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

Challenge Information:

Design a Blog Post Card - Design a Blog Post Card

Hi. Actually you don’t have

.read-more:hover {
background-color: pink;
}

but something different. Please check again.

worked. figured it out. Thank you for your help.

1 Like