Lesson Six - Style MachineIf you have had any previous experience with html, you may have come across <font> and <center> tags. AVOID THEM if you can. They belong to the old versions of html, and lead to problems. This tutorial is teaching you habits which will lead you towards the newer html 4 and xhtml standards. The newer standards have replaced those tags with a system named CSS - cascading style sheets. In the next exercise will create a simple css document, that will style our webpages. |
|
EXERCISE SIX A Open up Notepad, we are going to create a fresh page - but not of html this time, but of css! NOTE. that we are using the { and } symbols in css. Copy or type all of the following css script: h1 {font-family: arial; color: #339966; font-size: 60px}
Now Save as ourstyle.css into the website folder with the other files (remember to include the .css in the file name. You have created a stylesheet. Any html documents that refer browsers to this stylesheet, will follow its rules. For example, any paragraphs will use the georgia font, size 18 px. You could if you wished, even control the style of tables, borders, backgrounds, etc, from this single stylesheet. That will be your choice as you develop your skills. Now lets make a few alterations to our two web pages with Notepad, including the insertion of a reference to our stylesheet in each head for visiting browsers to use.. EXERCISE SIX B Open up Page One (index.htm) with your text editor. add the new line of code (highlighted below in strong) inside the head!, and some additional code to the link as shown below: <html>
EXERCISE SIX C Now open up Page Two (two.htm) with Notepad, and add the same line, again, inside the head, and the addition to the link thus: <html>
If you have correctly copied or pasted the code into your pages, and saved them, now check them out in the browser! Large green headers, smaller blue headers, three fonts. The important point is that the style with be constant across all of the pages of the website. |
|
AND FINALLY...META TAGS So you have built website that includes two linked pages, a stylesheet, a table, an image, etc, etc. You want people to find it? A few quick tips before you upload it to a web server - make it Search Engine Friendly. You can do this by:
As a final little exercise, I will show you how to create meta tags for Page One (index.htm), but remember, you have to decide upon your own keywords and description for your web pages. Add the strong text in the head as in this example: <html> |
|
|