Читать книгу CoderDojo: My First Website - Clyde Hatter - Страница 18

Оглавление

< BRINGING IT ALL TOGETHER >

MAKING THE HOME PAGE

By now you’ve made the About Us page, the Our Songs page and the See Us Play page. But to make them into a website you’ll need to link them all together so that you can go from one to another. We’re going to do that now by making the home page.

Open the about-us.html file. Then go to the File menu and choose the Save As option. Save the file as index.html.

NINJA TIP

Home pages are usually given a file name of index.html

<!DOCTYPE html> <html> <head> <title>Home</title> <link type="text/css" rel="stylesheet" href="css/my-first-stylesheet.css"/> </head> <body> <h1>We are the Nanonauts!</h1> <p>This is our website. Click on a link to visit a page:</p> <ul> <li><a href="about-us.html">About Us</a></li> <li><a href="our-songs.html">Our Songs</a></li> <li><a href="see-us-play.html">See Us Play</a></li> </ul> </body> </html>

The home page has three links on it. They appear inside the li elements of a ul list. The code to the right is the link to the About Us page.

Change index.html to look like this:

<a href="about-us.html">About Us</a>

CoderDojo: My First Website

Подняться наверх