Design a Blog Post Card - Design a Blog Post Card

Tell us what’s happening:

I can’t validate my exercise because I have these two problems: You should have an element with the class ‘read-more’ and your .read-more element must contain the text ‘Read More’. So, in my HTML code everything seems to be correct. Can someone help me?

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="Managing an email account">
        <div class="post-content">
            <h2 class="post-title">Key information</h2>
            <p class="post-excerpt">Lorem ipsum dolor sit amet consectetur adipisicing elit. Vitae veritatis consequatur minus cum ratione saepe dolorum non, nobis suscipit distinctio  mollitia possimus fuga?</p>
        </div>
        <a class="read-more">Read More</a>
    </div>
</body>
</html>
/* file: styles.css */
body {
  background-color: gray;
}

.blog-post-card {
  background-color: white;
  border-radius: 20px;
  width: 100%;
  text-align: center;
}

.post-img {
    width: 100%;
    height: auto;
    display: block;
    border-bottom: 4px solid #e5e7eb;  
    object-fit: cover;
}

.post-content {
    padding: 1.25rem;
}

.post-title {
    color: #111827;
    margin: 0.75rem 0 0.5rem 0;
}

.post-excerpt {
    color: #4b5563;
    margin: 0.5rem 0 1rem 0;
}

.read-more {
    color: white;
    background-color: #2563eb;
    margin: 1.25rem 0 0.75rem;
    padding: 0.75rem 1.5rem;
    border-radius: 10rem;
    display: inline-block;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.read-more:hover {
    background-color: #1d4ed8;
}

Your browser information:

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

Challenge Information:

Design a Blog Post Card - Design a Blog Post Card

Is this element inside the .post-content div? Please review User Story #3.

1 Like