HTML
HTML
Introduction to HTML
HTML stands for Hyper Text Markup Language. It is a formatting language used to define
the appearance and contents of a web page. It allows us to organize text, graphics, audio, and
video on a web page.
Key Points:
HTML Tags
Tag is a command that tells the web browser how to display the text, audio, graphics or video on
a web page.
Key Points:
HTML Basics
<HTML>
<HEAD>
<TITLE>The page title goes here.</TITLE>
</HEAD>
<BODY BGCOLOR="ffffff">
<P>Here is a simple paragraph.</P>
</BODY>
</HTML>
HTML Links
Links are found in nearly all web pages. Links allow users to click their way from page to page.
You can click on a link and jump to another document. When you move the mouse over a link,
the mouse arrow will turn into a little hand.
Syntax:
<a href="url">link text</a>
Example:
<a href="https://www.w3schools.com/html/"> HTML</a>
Image Link
It is common to use images as links:
<a href="default.asp">
<img src="smiley.gif" alt="HTML tutorial" style="width:42px;height:42px;border:0;">
</a>
Email Tag
HTML <a> tag provides you option to specifiy an email address to send an email. While using
<a> tag as an email tag, you will use mailto:email address along with href attribute. Following
is the syntax of using mailto instead of using http.
This code will generate following link which you can use to send email.
Mail Message
Now if a user clicks this link, it launches one Email Client ( like Lotus Notes, Outlook Express
etc. ) installed on your user's computer.
Default Settings
You can specify a default email subject and email body alongwith your email address. Following
is the example to use default subject and body.
<a href="mailto:[email protected]?subject=Feedback&body=Message">
Send Feedback
</a>
This code will generate following link which you can use to send email.
Send Feedback
HTML Lists
HTML provide three ways for specifying lists of information. All lists must contain one or more
list elements. Lists may contain:
<ol> - An ordered list. This will use different schemes of numbers to list your items.
<ul> - An unordered list. This will list items using plain bullets.
<dl> - A definition list. This arranges your items in the same way as they are arranged in
a dictionary.
Ordered Lists
An ordered list is a collection of related items that have an order or sequence. This list is created
by using HTML <ol> tag. Each item in the list is marked with a bullet using <li> tag.
Eg.
<ol type="1">
<li>Beetroot</li>
<li>Ginger</li>
<li>Potato</li>
<li>Radish</li>
</ol>
Type attribute specifies the type of number used. It may have the following values:
<ol type="1"> - Default-Case Numerals.
<ol type="I"> - Upper-Case Numerals.
<ol type="i"> - Lower-Case Numerals.
<ol type="a"> - Lower-Case Letters.
<ol type="A"> - Upper-Case Letters.
You can use start attribute for <ol> tag to specify the starting point of numbering you need.
Following are the possible options:
Un-ordered Lists
An unordered list is a collection of related items that have no special order or sequence. This list
is created by using HTML <ul> tag. Each item in the list is marked with a bullet using <li> tag.
Eg.
<ul type="square">
<li>Beetroot</li>
<li>Ginger</li>
<li>Potato</li>
<li>Radish</li>
</ul>
Type attribute specifies the type of bullet. It may have three values – square, disc, circle
Definition Lists
HTML support a list style which is called definition lists where entries are listed like in a
dictionary or encyclopedia. The definition list is the ideal way to present a glossary, list of terms,
or other name/value list.
Eg.:
<dl>
<dt><b>HTML</b></dt>
<dd>This stands for Hyper Text Markup Language</dd>
<dt><b>HTTP</b></dt>
<dd>This stands for Hyper Text Transfer Protocol</dd>
</dl>
Output
HTML
This stands for Hyper Text Markup Language
HTTP
This stands for Hyper Text Transfer Protocol
Tables in HTML
The HTML tables allow to arrange data like text, images, links, other tables, etc. into rows and
columns of cells.
The HTML tables are created using the <table> tag in which the <tr> tag is used to create table
rows and <td> tag is used to create data cells. <th> tag is used to specify table heading row.
Eg.
<table border="1">
<tr>
<th>Name</th>
<th>Salary</th>
</tr>
<tr>
<td>Ramesh Raman</td>
<td>5000</td>
</tr>
<tr>
<td>Shabbir Hussein</td>
<td>7000</td>
</tr>
</table>
Output
Name Salary
Ramesh Raman 5000
Shabbir Hussein 7000
Tables Backgrounds
You can set table background using one of the following two ways:
bgcolor attribute - You can set background color for whole table or just for one cell.
background attribute - You can set background image for whole table or just for one
cell.
<frameset rows="10%,80%,10%">
<frame name="top" src="/html/top_frame.htm" />
<frame name="main" src="/html/main_frame.htm" />
<frame name="bottom" src="/html/bottom_frame.htm" />
</frameset>
Vertical Frames
<frameset cols="25%,50%,25%">
<frame name="left" src="/html/top_frame.htm" />
<frame name="center" src="/html/main_frame.htm" />
<frame name="right" src="/html/bottom_frame.htm" />
</frameset>