I’m going to build my very own Web page
No Comments
Written by Robert on February 20, 2008 – 3:56 pm
It’s going to be very simple, mind you, but you’ll see how easy it really is to build a page. I ’ll expand on these concepts as I move into the next part, on HTML. To build a Web page using pure HTML, first you need to open up a text document. Usually, I write the code in Nvu, but for this exercise, I’m going to type it directly into Notepad, the simple text editor that comes with Windows. First, open up Notepad. The easiest method is to go to your Start menu, select Run, and type in “notepad”. If typing in “notepad” doesn’t work, try typing in “notepad.exe” or “C:\Windows\notepad.exe”. Now that you have Notepad open, it’s time to type in the HTML. I talked about the intro to any HTML program. That’s right, first you need to type in the following tag: <HTML> What does this mean? It tells the Web browser that the document is a Web page and should be drawn as such. This tag encloses the entire HTML portion of your Web page. In most cases, this is the first tag in the source.
So what now? You have to create something that will appear on the screen. Let’s start off with a title. To create a title, you need to use the <HEAD> tag. From there, it’s pretty easy to create the title. First things first. Within the two HTML tags in your Notepad window, type <HEAD> and </HEAD>. Within the <HEAD> tags, you need to write the title between a <TITLE> tag and a </TITLE> tag. This tag defines the title of the page and places it at the top of the screen and in the system task bar. So now you have a title for the page. Before we learn how to open up this document and see the Web page, first let’s write something in the document. After the </HEAD> tag, add the following:
<BODY>
Hello, World!
</BODY>
Now we have some actual text up in here. Let’s open this up and see it in the Web browser! First, save the file. In Notepad, go to File > Save and choose a location to save it in (I recommend the Desktop). Before you click Save, you need to rename the file. Change the filename to Helloworld.html. Make sure you append the .html suffix. Now that the file is saved, navigate to the folder where you saved the file. Just double-click the file, and it should open up in Internet Explorer. Now, this is a little boring. Let’s add a little bit of color. How about changing the text to white and the background to black? To do this, we need to edit the document. Changing the color of the background involves adding an attribute to the <BODY> tag. What’s an attribute? Basically, it’s a command placed within a tag that changes something in the document.When we add color to the document, we need to add an attribute that tells the Web browser what the color will be. This attribute is called BGCOLOR, and it goes inside the <BODY> tag. Modify the tag in the Notepad document to look like this:
<BODY BGCOLOR=black>
Not too bad, eh? Now save it and reopen the file in the Web browser. Uh-oh! The entire page is black.You can’t see the text at all. This is because both the text and the background are black. Let’s change this. We need to add another tag, the <FONT> tag, to change the color of the text. In addition, we need to use the COLOR attribute to change the color of the text. Change the Hello,World! line to look like this:
<FONT COLOR=white>Hello, World!</FONT>
Now save the file and reopen it in the Web browser. This is an addition to an HTML tag that changes the action of the tag in some way.
Popularity: 21% [?]
