A quick poorly written lesson:
Starting your document:
To start your document, you must define the documents type and open both the HTML and head tags. The head tag is effectively short for header. You can define the title of the webpage, link or create a stylesheet and so forth. For example:
The <title> tag sets the title displayed in the browser, and the <link rel="stylesheet"...> links to an external stylesheet, found in the folder "style" with the filename "style.css". You then close the head tag using </head>.Code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>My first webpage!</title> <link rel="stylesheet" type="text/css" href="style/style.css"> </head>
Adding Content
You will then want to add content to your webpage.
The above opens and closes the body tag, displaying a heading with a small paragraph.Code:<body> <h1>Welcome!</h1> <p>This is my first webpage!</p> </body>
Closing your document:
Finally, you will want to close the HTML tag, completing the webpage.
--Code:</html>
You only have ONE: HTML, head and body tag. Your final document should look similar to this:
Indenting your code will truely help you to follow it too. It is far easier to read and allows you to pinpoint sections.Code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>My first webpage!</title> <link rel="stylesheet" type="text/css" href="style/style.css"> </head> <body> <h1>Welcome!</h1> <p>This is my first webpage!</p> </body> </html>
I trust this will help you.





Reply With Quote






