| Level Navigation: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10⚡ | 11⚡ | 12⚡ | 13⚡ | 14⚡ | 15 | 16 | 17 | 18⚡ | 19 | 20 |
User Story: As a user, I want to read my Mad Libs story in a beautiful, easy-to-read format so that I can fully enjoy the experience.
Style the story display with CSS and improve the user experience. Add CSS styling directly in your server route response.
Need help with styling? Check out these snippets:
res.send()href="/mad-libs-form.html"const storyHTML = `
<!DOCTYPE html>
<html>
<head>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<title>Your Mad Libs Story</title>
</head>
<body>
<div class="container mt-5">
<div class="card">
<div class="card-body">
<h1 class="card-title">Your Mad Libs Story</h1>
<p class="card-text">${storyContent}</p>
<a href="/mad-libs-form.html" class="btn btn-primary">Create Another Story</a>
</div>
</div>
</div>
</body>
</html>`;
res.send(storyHTML);
<div class="container mt-5">
<div class="card">
<div class="card-body">
<h1>Your Story</h1>
<p>Story content goes here...</p>
<a href="/mad-libs-form.html">Create Another Story</a>
</div>
</div>
</div>
Server Route vs Static Files: Unlike your form HTML file (which is static), the story display HTML is generated dynamically in your server route. This means you include the CSS link directly in the HTML string that you send with res.send().