6 Adding links and navigation

 

This chapter covers

  • Creating links to other sites and pages
  • Creating a navigation bar for your site
  • Asking ChatGPT to help you design your pages
  • Prompting ChatGPT to build an information website for an organization
  • Examining and customizing ChatGPT’s web page code

In each of the web projects you’ve seen so far in this book, you’ve cajoled ChatGPT into providing you with the code for a single web page. One-page websites are legion on the web, but it’s more common for a site to have two or more pages. Once you add that second page, however, questions quickly arise: How do you get a site visitor from your home page to the other page? And once someone gets to that other page, how do you get them back to the home page? How do you figure all this out with a site that has three, four, or even more pages?

Answering these and similar questions is the topic of this chapter. In the pages that follow, you learn how to enable a visitor to your site to jump from one page to another by asking ChatGPT to craft some web page code that creates a clickable link to another page. You also learn how to ask ChatGPT to create a special web page element called a navigation bar that brings links to all your site pages into a single, handy location for easy access.

6.1 Understanding this chapter’s project

6.2 Building the information site home page

6.2.1 Creating links

6.2.2 Creating the navigation bar

6.2.3 Crafting the home page prompt

6.3 Examining the home page code

6.3.1 Examining the HTML

6.3.2 Examining the CSS

6.4 Customizing the home page

6.5 Building prompts for the other site pages

Summary