![]() |
|
| HTML for the complete beginner |
The BasicsTo start making a web page we need a text-based editor like Notepad or WordPad (not Microsoft Word). These can be found by clicking Start/Programs/Accessories/... You may copy and paste if you wish but typing it out will benefit you more, as you'll find it second nature later on. The more you type it, the easier you'll remember it, the easier it will be. Before we start it's best to create a new folder for your work. To create a new folder we can A) Right click in an existing folder like "My Documents" and choose "New/Folder" or B) Within an open folder (like My Documents), click on "File/New/Folder" from the toolbar (top left). You can call this folder anything you like, but naming it something like "My web page" or "Web page" will make it easier later on to find it. The first thing we learn is that HTML is made up of tags, these tell the browser what we want to do. All (99%) HTML tags start with an opening tag < > and end with closing a tag </ >, (the / indicates the end). An HTML document is made up of two parts, the <head> </head> and <body> </body>.The <head> </head> is for the browser and all that is placed in the head is unseen (except the title) and the <body> </body> is for all your pages content, so lets add the rest of the basic tags, like so: <html> <head> <title> Your page title will go here </title> </head> <body> Your contents will go here </body> </html>
This is your basic HTML page, copy (type) this into your text editor (Notepad or similar), save this as index.html. Choose 'File/Save as', then 'File name' as index.html, save as type 'Any file (*.*)' into your folder you have set aside for your web page. Be careful the file doesn't get saved as index.html.txt If it does, right click on the file and rename, removing the .txt ![]() The first page of your site is 'index.html' which is the default start page, you may save any other pages anyway you like, i.e. links.html, about_me.html, updates.html, page-1.html etc but you must not use spaces or character symbols like !, @, #, $, %, " etc. Instead of a space, you may use a hyphen - or an underscore _ as a separator. (%20 is not allowed either). To open/view your new page, just double click on the index.html file in your folder, and the page will open in your default web browser. To edit your content, you just right click on the page and choose 'View source' in Internet Explorer or 'file/Edit Page' in Netscape. This is all done off line. Change your file, click file/save and hit 'Refresh' or 'Reload' to view the updated page on your browser. ![]()
This is the hardest part to learn for now, as these tags are sectioned, all other HTML tags are used within the body section. Page layoutIt is far easier to edit your pages if you keep the tags tidy, this is tidy and easy to edit:<html> <head> <title> Your page title will go here </title> </head> <body> Your contents will go here </body> </html> Below is messy and hard to edit (especially when you add all your contents): <html> <head> <title> Your page title will go here </title> </head> <body> your contents will go here </body> </html> HTML is not case sensitive, but the new version of HTML (XHTML) is. File names are, picture.jpg is not the same as PICTURE.jpg or picture.JPG. As a rule I keep everything lowercase including filenames and don't have problems. If/when you advance onto things like JavaScript, DHTML, CSS etc, you will have to be careful with your coding as it is case sensitive, keep it all lower case and you wont have problems. Content, navigation and layout would be the top three components for a web site, and this is where many people fail. You will see this comment throughout the site, as I want you to start off on the right foot. CommentsComments are great little messages that you can add in your HTML code to show where things start, the date you changed something, a reminder ...<!-- Everything between these tags is not seen except in source code --> <!-- (start) -->(finish). It can confuse the older browsers using more than the four required dash's (-), so using more inside the comments, should be avoided. Comments can be single lined: <!-- this is a comment --> or multi lined: <!-- this is a comment still until I reach the end tag which is below --> HTML tags within comment tags should also be avoided lets try some, copy (type) this into the page you made before <html> <head> <title> Your page title will go here </title> </head> <body> <!-- this is a comment unseen by viewer --> This is typed between the comments <!-- this is another comment unseen by viewer --> </body> </html> Which should look like this:
Now right click on the page (your page) and click "view source", you'll see the comments are there, but not on the screen. Common errors
Summary
Exercise
Optional Quiz
|
||||||||
| © 1999 - 2009 EZHTML (munchtech.com) Copyright notice |