Link to Table of Contents:TOC
In HTML, you will use tags to create a website of your own! In this lesson, we will introduce you to HTML. We will discuss some of the basic concepts in HTML, and in the next several lessons, we will explain how to use HTML to create specific elements for your website. Here is the hello, world! program in HTML.
<!DOCTYPE html> <html> <body> <!--Notes are recorded like this in HTML--> <p>hello, world!</p> </body> </html>
Tags are important aspects of HTML. Everything you write in HTML is in the form of tags. Tags go by pairs, in which each pair has an opening tag and a closing tag. For example:
<!DOCTYPE html> <html> <body> <p>Text Text Text</p> </body> </html>
As shown in this HTML program, each pair of tags has the opening tag(html,body,p); and the closing tag(/html,/body,/p). The closing tags always have the slash(/)before repeating which tag it is closing.
Each tag consists of "<" sign and a ">" sign, which indicates a tag.
It is also a good habit to indent to show structure of the program, although not required in HTML.
You can add attributes to the opening tag in order to provide additional information about the element. The form of the attributes in an element needs to be:
<p align="center">Centered text</p>
This attribute, for example, give the computer the extra information of "center the text".
Play around with the hello, world! program. Change the text you are printing, add some more <p> tags, and try to add a the align="center" attribute to it.
We will discuss this in future lessons, but if you are curioius: