Step 3: Adding HTML to the Page
Next, we’ll add some <div>
s in the <body>
. These <div>
s have class names that match those specified in the component configuration, and is where the library will place the components.
We can now delete the wishful-thinking class <div>
and replace the contents of the answers-layout <div>
with the following:
<div class="answers-layout">
<div class="search-bar"></div>
<div class="spell-check"></div>
<div class="direct-answer"></div>
<div class="universal-results"></div>
<div class="location-bias"></div>
</div>
Our file should now look like this, and we’re one more step away from having a search experience ready!
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Answers Test Experience</title>
<!-- Answers CSS-->
<link rel="stylesheet" type="text/css" href="https://assets.sitescdn.net/answers/v1/answers.css" />
<!-- Answers Layout styling -->
<style>
.answers-layout {
max-width: 50rem;
margin: auto;
}
</style>
<!-- Answers JS-->
<script src="https://assets.sitescdn.net/answers/v1/answers.min.js"></script>
</head>
<body>
<div class="answers-layout">
<div class="search-bar"></div>
<div class="spell-check"></div>
<div class="direct-answer"></div>
<div class="universal-results"></div>
<div class="location-bias"></div>
</div>
</body>
</html>
Feedback
<% elem.innerText %>