Tell us what’s happening:
i am getting the following things wrong plz.. help
4. You should have a .newspaper selector that sets its elements’ font-family to 'Open Sans', sans-serif .
5. 18. You should have a .name selector that sets its elements’ font-family to 'Times New Roman', serif .
6. 21. You should have a .headline selector that sets its elements’ font-size to 2em.
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>Newspaper Article</title>
<link href="styles.css" rel="stylesheet">
</head>
<body>
<div class="newspaper">
<p class="name">name</p>
<p class="date">August 5, 2025</p>
<p class="headline">headline</p>
<p class="sub-headline">sub-headline</p>
<p class="author">author</p>
<p class="text">text</p>
<p class="text">text</p>
</div>
</body>
</html>
/* file: styles.css */
html {
font-size: 24px;
}
.newspaper {
font-size: 16px;
font-family: 'Open Sans', sans-serif, Arial, sans-serif; /* Added fallback */
height: 100vh;
width: 100%;
}
.name {
font-size: 2rem;
font-family:'Times New Roman', serif, Georgia, serif;
margin-bottom: 0;
}
.name, .author {
text-transform: uppercase;
}
.date, .name {
text-align: center;
}
.date {
margin-bottom: 0;
}
body {
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.sub-headline {
font-weight: 100;
font-size: 1.5rem;
font-style: italic;
}
.author {
font-weight: bold;
}
.text {
text-indent: 20px;
line-height: 2rem;
}
.text::first-letter {
font-size: 2rem;
}
.headline {
font-size: 2rem;
font-weight: bold;
}
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36
Challenge Information:
Build a Newspaper Article - Build a Newspaper Article
https://www.freecodecamp.org/learn/full-stack-developer/lab-newspaper-article/build-a-newspaper-article