Lesson 1 : - HTML Basics
(483 reads)
HTML Basics
Here is some basic HTML code:-
<html>
<head>
<title>Title of page</title>
</head>
<body>
This is my first homepage. <b>This text is bold</b>
</body>
</html>
This is an HTML element:
<b>This text is bold</b>
The HTML element starts with a start tag: <b>
The content of the HTML element is: This text is bold
The HTML element ends with an end tag: </b>
The purpose of the <b> tag is to define an HTML element that should be
displayed as bold.
This is also an HTML element:
<body>
This is my first homepage. <b>This text is bold</b>
</body>
This HTML element starts with the start tag <body>, and ends with the
end tag </body>.
The purpose of the <body> tag is to define the HTML element that contains
the body of the HTML document.
Using Lowercase Tags?
HTML tags are not case sensitive: hence <B> means the same as <b>.
You will notice as you browse the web that most tutorials use uppercase HTML
tags in their examples. We always use lowercase tags. Why?
If you want to prepare yourself for the next generations of HTML you should
start using lowercase tags. The World Wide Web Consortium (W3C) recommends lowercase
tags in their HTML 4 recommendation, and XHTML (the next generation HTML) demands
lowercase tags.
Attributes of Tags
Tags can have attributes. Attributes can provide additional information about
the HTML elements on your page.
This tag defines the body element of your HTML page: <body>. With an added
bgcolor attribute, you can tell the browser that the background color of your
page should be red, like this: <body bgcolor="red">.
This tag defines an HTML table: <table>. With an added border attribute,
you can tell the browser that the table should have no borders: <table border="0">
Attributes always come in name/value pairs like this: name="value".
Attributes are always added to the start tag of an HTML element. |