In index.html, add two paragraphs (for the quote and the author) and a button,
all inside a <div>:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<title>Home</title>
<link rel="stylesheet" href="styles.css" />
</head>
<body>
<div id="quote-container">
<p id="quote"></p>
<p id="author"></p>
<button id="new-quote" onclick="setQuote()">New Quote</button>
</div>
<script src="script.js"></script>
</body>
</html>
In styles.css, update the code to this:
#quote-container {
display: flex;
flex-direction: column;
align-items: center;
padding: 100px;
text-align: center;
}
#quote {
font-size: 50px;
font-weight: bold;
margin-bottom: 20px;
}
#author {
font-size: 36px;
font-style: italic;
}
#new-quote {
background-color: blue;
color: white;
border: none;
padding: 20px 30px;
font-size: 28px;
cursor: pointer;
margin-top: 20px;
border-radius: 5px;
}
In script.js, add the following code:
function setQuote() {
const quote = document.getElementById('quote');
const author = document.getElementById('author');
const randomQuote = 'When you eat close your mouth - Adam';
const quoteParts = randomQuote.split(' - ');
quote.innerHTML = quoteParts[0];
author.innerHTML = `- ${quoteParts[1]}`;
}
When you run it and click New Quote, a
quote appears on a clean card:

<div id="quote-container">
<p id="quote"></p>
<p id="author"></p>
<button id="new-quote" onclick="setQuote()">New Quote</button>
</div>
A <div> (short for division) is an invisible container. It groups the
paragraphs and button so we can position and style them together.
