HTML Tutorial W3schools
HTML Tutorial W3schools
What is HTML?
HTML (Hyper Text Markup Language) is a language for describing web pages.
Terms
HTML tags are keywords surrounded by angle brackets like <html>. HTML tags
normally come in pairs, with starting and ending tags, like <b> and </b>.
Everything from the start to the end tag is called HTML element. Empty elements like
<br> do not have closing tags. Tags are not case sensitive, so <P> means the same as <p>.
HTML elements can have attributes, which provide additional information about the
element. Attributes are always specified in the start tag, and come in name-value pairs like
name=value. Values are always enclosed in quotes i.e. name = Joe. Attribute names and values are
case insensitive.
This tutorial will give you all the essential tags that you will need for your assignment. For
additional tags, please refer the complete HTML reference, listed at http://www.w3schools.com/
tags/default.asp. You can play around with HTML tags by using the HTML editor available on the
w3schools website - http://www.w3schools.com/html/tryit.asp?filename=tryhtml_intro
HTML example
Open a text editor (for eg Notepad on Windows, Emacs/vi on MAC). Type the following
example and save the file as hello.html (You could also save it using a .htm extension).
<html>
<head>
<title>
My first html page
</title>
</head>
<body>
<h1>Hello World</h1>
<p>Hello world, my name is Joe.</p>
</body>
</html>
In this example, the text between <html> and </html> describes the web page. Head
elements, like title are included in between <head> and </head>. The title of the web page is
specified between <title> and </title>. The text between <body> and </body> is the visible page
content. The text between <h1> and </h1> is displayed as a heading. The text between <p> and
</p> is displayed as a paragraph.
HTML Basic
Headings are defined with <h1> to <h6> tags.
<h1>This is a heading>/h1>
Comments are defined between <!-- and -->. Please get into the habit of adding comments
to make your html code readable.
Styles
CSS is used to style HTML elements. CSS can be added to HTML as a separate style sheet
file (css file), in the style element in HTML head section or in the style attribute in HTML elements.
The preferred way to add CSS to HTML, is to put CSS syntax in separate CSS files. Please
refer to the CSS section of the tutorial to learn more about styles. Below is an example to add style
to a HTML element.
Links are specified using the <a> tag and can be used either to
document
link to the CS89 section from another page. Please note that such a page doesnt exist!
It is possible to use an image as a link as well.
a>
You could also link to a mail message, if you have mail installed.
<a href="mailto:someone@example.com?Subject=Hello%20again">
Send Mail</a>
Images
Tables
Tables are defined using <table> tag. Tables are divided into rows (<tr> tag); each row into
data cells (<td> tags). The data cells can contain text, images, lists, forms, other tables etc. Table
headers are specified using <th> tags. Cellpadding attribute creates more white space between the
cell content and its borders. Cellspacing attribute increases distance between cells.
An unordered list starts with <ul> tag. Each item starts with <li> tag. List items are marked
with bullets.
<ul>
<li>Coffee</li>
<li>Milk</li>
</ul>
An ordered list starts with the <ol> tag. List items are marked with numbers.
<ol>
<li>Coffee</li>
<li>Milk</li>
</ol>
A definition list is a list of terms, with a description of each item and is defined using <dl>
tag. <dt> defines an item in the list and <dd> describes the item.
<dl>
<dt>Coffee</dt>
<dd>- black hot drink</dd>
<dt>Milk</dt>
<dd>- white cold drink</dd>
</dl>
Escape characters
You might need to specify entity names to introduce certain symbols on your
webpage. You can find a list of escape characters here - http://
www.theukwebdesigncompany.com/articles/entity-escape-characters.php