Could someone please lead me in the right direction and explain to me what need to do to I am doing wrong ?
Your code so far
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>XYZ Bookstore Page</title>
</head>
<body>
<h1>XYZ Bookstore</h1>
<p>Browse our collection of amazing books!</p>
<div class="card-container">
<div class="card" id="sally-adventure-book">
<h2>Sally's SciFi Adventure</h2>
<p>This is an epic story of Sally and her dog Rex as they navigate through other worlds.</p>
<button class="btn">Buy Now</button>
</div>
<div class="card" id="dave-cooking-book">
<h2>Dave's Cooking Adventure</h2>
<p>This is the story of Dave as he learns to cook everything from pancakes to pasta, one recipe at a time.</p>
<button class="btn">Buy Now</button>
</div>
</div>
<!-- User Editable Region -->
<p>Review your selections and continue to checkout.</p>
<div class="btn-container">
<button class="btn"><view-cart-btn="btn">View cart</button>
<button class="btn"><checkout-btn="btn">Checkout</button>
</div>
<!-- User Editable Region -->
</body>
</html>
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 Edg/143.0.0.0
id is an attribute, just like class is an attribute in the div element above your buttons. The syntax to add an id attribute to the button element is the same as the syntax you used to add the class attribute to the div element.
It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge. How to Help Someone with Their Code Using the Socratic Method
We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.
I see you corrected the first mistake but while adding ‘id’ attribute again there is syntax error. Please add the id attribute inside the button tag. Here is an example,
Mod Edit: SOLUTION REMOVED
Modify both buttons to follow the same pattern as above. Keep practicing so you will understand how the html elements are written with proper open and close tags.
Yes. And that example also shows the syntax used for adding attributes inside an element’s starting tag. So, knowing that, all you need to do is add an id attribute inside the button element’s starting tag with the value given in the instructions.