Tell us what’s happening:
I have changed the width from auto to 150px to 300px to 50% to 100%, randomly to see what might work, but it won’t accept what I enter for the img width.
Also, I’m wondering why “block” wouldn’t work for display under .read-more, but “inline-block” did.
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>
<div class="blog-post-card"</div>
<img src="https://www.storyblocks.com/video/stock/close-up-of-female-hands-typing-on-the-laptop-keyboard-hx3xhrvfeizdim9us" class="post-img" alt="person typing"</img>
<div class="post-content"</div>
<h2 class="post-title">Person typing</h2>
<p class="post-excerpt">asdfasdfasdfdsfaweaeiee safasfdsf eererew</p>
<a href="https://www.storyblocks.com/video/stock/close-up-of-female-hands-typing-on-the-laptop-keyboard-hx3xhrvfeizdim9us" class="read-more">Read More</a>
<body>
</body>
</html>
/* file: styles.css */
.blog-post-card {
border: 2px solid red;
border-radius: 25px;
width: auto;
background-color: white;
text-align: center;
padding: 50px;
}
.post-content {
padding: 30px;
}
.read-more {
background-color: blue;
margin: 50px;
display: inline-block;
border-radius: 25px;
padding: 30px;
}
.read-more:hover {
background-color: yellow;
font-size:18px;
}
.post-img {
width: 150px;
border-bottom: 2px dashed;
}
.post-title {
margin: 20px;
color: yellow;
}
.post-excerpt {
margin: 20px;
color: purple;
}
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:142.0) Gecko/20100101 Firefox/142.0
Challenge Information:
Design a Blog Post Card - Design a Blog Post Card
https://www.freecodecamp.org/learn/full-stack-developer/lab-blog-post-card/lab-blog-post-card