Giving HTML a try

Published 26/05/2004 10:30   |    Updated 13/02/2009 13:09
Think you're ready to try some coding out for yourself?

Then have a go at this simple exercise.

 

If you're running Windows, start Notepad. Or SimpleText if you're on a Mac. (If you're running OSX then launch TextEdit and select the following in preferences: 'Plain text' rather than 'Rich text' and 'Ignore rich text commands in HTML files' - otherwise your code may not work.)

 

When you've done that, enter the following (replacing John with your own name if you like):


 

<html>

<head>

<title>John's Website</title>

</head>

<body>

Welcome to John's homepage.<b>Hi, nice of you to visit</b>

</body>

</html>

 

Then save this file as homepage.html. You've just written your first web page.

 

To look at it as though it were live and online start your Internet browser and select "Open" (or "Open Page") in the File menu. In the dialogue box choose "Browse" (or "Choose File") and find your newly created homepage.html file. Highlight it and click "Open". Or on a Mac just drag and drop the file on a broswer icon in the dock.

 

You should see an address that looks something like "C:\MyDocuments\homepage.html". Click OK, and your browser should display the page.

 

Inside Knowledge

Make sure you save your HTML files with the correct names and .html file extensions, and that you use the same name when opening the file in your browser. Otherwise your browser may not be able to see it.

 

 

« Optimising Images

Test Yourself »

Please tell us how we can make this answer more useful.

Print