HTML Quick Reference
HTML Quick Reference
Quick Reference
By:
Mohammed Hossam El-Din
• Introduction:
HTML (Hyper Text Markup Language) is a standard
language used to build the user interface for web pages.
The main concept of the language is the concept of tags,
that every element in the interface is built using tags
Example:
<html>
<body bgcolor="RED">
</body>
</html>
Note:
Some tags do not need to be closed like list items and
ordered list.
Example:
<html>
<body>
<b>A Bold Text Will be Here</b>
<br>
<u>Or underlined</u>
<br>
<i>or italic</i>
<br>
<b><i><u>Or all at once</u></i></b>
</body>
</html>
Page 1 of 5
From the previous example we get some new tags
<b></b> <!--Makes the text bold -->
<u></u> <!--Makes the text underlined -->
<i></i> <!--Makes the text italic -->
Note:
The new line tag <br> doesn't have a </br> to close it, it is one of
the tags that doesn't have a close one.
Page 2 of 5
• Tables
Tables is one of the main reasons of using HTML that pages need
tables to view data and to organize the page.
The tables are built using 3 main elements:
1. the table tag <Table>
2. the table row tag <Tr>
3. the table data tage <Td>
4. there are some other tags for tables like <span> but
the first three can do everything in tables we don't need
the others.
Example:
<html>
<title>Sample Page</title>
<body>
<table border = "1" cellspacing = "1" cellpadding ="2">
<tr>
<td> Table cell number 1 of row 1 </td>
<td> Table cell number 2 of row 1 </td>
</tr>
<tr>
<td> Table cell number 1 of row 2 </td>
<td> Table cell number 2 of row 2 </td>
</tr>
<tr>
<td>
<img src = "MyImage.jpg" height =
"100" width = "100">
</td>
<td><a href="http://www.yahoo.com">
Click here to goto yahoo
</a>
</td>
</tr>
</table>
</body>
</html>
Note:
1. Tables also can be nested that a table can contains
multiple tables in it <td> Tag.
2. You should close all tags in the table as one opened tag
can destroy your table.
Page 3 of 5
• Links
Links are needed to link pages with each others even it is a
link to another page in the same website or in another
website.
Example:
<html>
<title>Page One</title>
<body>
<h1>Page One</h1>
<br><br>
<a href ="Page2.htm">Page 2 </a>
<br>
Pictures also can be a link.
<br>
<a href="http://www.yahoo.com">
<img src = "MyImage.jpg" alt="My Pic">
</a>
</body>
</html>
• Lists
The list is very useful to organize data in items like
Unordered Lists
o Data1
o Data2
o Data3
Or
Ordered Lists
1. Data1
2. Data2
3. Data3
Page 4 of 5
<br>
Or using the unordered lists
<br>
<ul>
<li>Item1
<li>Item2
</ul>
</body>
</html>
• Forms
The most important element in HTML language, which is
responsible for sending data to other pages.
Example:
<html>
<body>
<form name = "MyForm" Method = "Post" action =
"Page.asp">
Username:<input type="text" name = "Username">
<br>
Password:<input type = "Password" name = "pass">
<br>
<input type = "Radio" name = "Martial Status" value =
"Married"> Married
<br>
<input type = "Radio" name = "Martial Status" value =
"Single"> Single
<br>
Occupation
<select name ="Occupation">
<option value="Eng">Engineering
<option value="Doc">Doctor
<option value="Std">Student
</select>
<br>
Hobbies
<br>
<input type = "CheckBox" name="Hobbies" value =
"Football">Football
<br>
<input type = "CheckBox" name="Hobbies" value =
"Reading">Reading
<br>
<input type="Submit" Value = "Save Data">
<input type="Reset" Value = "Reset">
</form></body></html>
Page 5 of 5