Introduction To HTML PDF
Introduction To HTML PDF
AN INTRODUCTION
TO WEB PAGE
PROGRAMMING
INTRODUCTION TO HTML
With HTML you can create your own Web site.
HTML stands for Hyper Text Markup Language.
HTML is derived from a language SGML (Standard
Graphics Markup Language).
The future of HTML is XML (eXtended Markup
Language).
HTML is not a programming language, it is
a Markup Language.
A markup language is a set of markup tags.
HTML uses markup tags to describe web pages.
HTML is not case sensitive language.
HTML documents contain HTML tags and plain
text.
HTML Elements and
Tags
A tag is always enclosed in angle bracket
<>like <HTML>
HTML tags normally come in pairs like
<HTML> and </HTML> i.e.
Start tag = <HTML>
End tag =</HTML>
Start and end tags are also called opening
tags and closing tags
HOW TO START
Write html code in notepad.
Save the file with (.Html)/(.Htm) extension.
View the page in any web browser viz.
INTERNET EXPLORER, NETSCAPE
NAVIGATOR etc.
The purpose of a web browser (like internet
explorer or firefox) is to read html
documents and display them as web pages.
Code With HTML
<HTML>
<HEAD>
<TITLE>
MY FIRST PAGE
</TITLE>
</HEAD>
<BODY>
GLOBAL INFORMATION CHANNEL
</BODY>
</HTML>
Explain these tags
Container Element:->
Container Tags contains start tag
& end tag i.e.
<HTML>… </HTML>
Empty Element:->
Empty Tags contains start tag i.e.
<BR>
Text Formatting Tags
Heading Element:->
<IMG SRC="picture.gif“>
<IMG SRC="picture.gif“ HEIGHT="30"
WIDTH="50">
Image attributes -
<img> tag
<img> Defines an image
<Src> display an image on a page,Src
stands for "source".
<Alt> Define "alternate text" for an
image
<Width> Defines the width of the image
<Height> Defines the height of the image
<Border> Defines border of the image
<Hspace> Horizontal space of the image
<Vspace> Vertical space of the image
<Align> Align an image within the text
<background> Add a background image to an
HTML page
Code & Result of the
Image
<html><body>
<p><img
src="file:///C:/WINDOWS/Zapotec.bm
p"
align="left" width="48" height="48"> </p>
<p><img src
="file:///C:/WINDOWS/Zapotec.bmp"
align="right" width="48" height="48"></p>
</body></html>
<HTML>
<<body
background="file:///C:/WINDOWS/So
ap%20Bubbles.bmp" text="white">
<br><br><br>
<h2> Background Image!</h2>
</BODY></HTML>
Code & Result of the
Image
<html><body>
<p>An image
<img src="file:///C:/WINDOWS/Zapotec.bmp"
align="bottom" width="48" height="48"> in the text</p>
<p>An image
<img src ="file:///C:/WINDOWS/Zapotec.bmp"
align="middle" width="48" height="48"> in the text</p>
<p>An image
<img src ="file:///C:/WINDOWS/Zapotec.bmp"
align="top" width="48" height="48"> in the text</p>
<p>Note that bottom alignment is the default
alignment</p>
<p><img src ="file:///C:/WINDOWS/Zapotec.bmp"
width="48" height="48">
An image before the text</p>
<p>An image after the text
<img src ="file:///C:/WINDOWS/Zapotec.bmp"
width="48" height="48"> </p>
</body></html>
Code & Result of the
Image
<html><body>
<p><img
src="file:///C:/WINDOWS/Zapotec.bmp"
align="bottom" width="20" height="20">
</p>
<p><img src
="file:///C:/WINDOWS/Zapotec.bmp"
align="middle" width="40" height="40"></p>
<p><img src
="file:///C:/WINDOWS/Zapotec.bmp"
align="top" width="60" height="60"></p>
<p><img src
="file:///C:/WINDOWS/Zapotec.bmp"
width="80" height="80"> </p>
<p><img src
="file:///C:/WINDOWS/Zapotec.bmp"
width="100" height="100"> </p>
</body></html>
HTML Table Tag
<table> used to create table
<tr> table is divided into rows
<td> each row is divided into data cells
<th> Headings in a table
<Caption> caption to the table
<colgroup> Defines groups of table columns
<col> Defines the attribute values for one
or more columns in a table
<thead> Defines a table head
<tbody> Defines a table body
<tfoot> Defines a table footer
<Cellspacing> amount of space between table cells.
<Cellpadding> space around the edges of each cell
<Colspan> No of column working with will span
<rowspan> No of rows working with will span
<Border> attribute takes a number
Code & Result of the
Table
<html>
<body>
<h3>Table without
border</h3>
<table>
<tr> <td>MILK</td>
<td>TEA</td>
<td>COFFEE</td>
</tr>
<tr> <td>400</td>
<td>500</td>
<td>600</td>
</tr>
</table>
</body>
</html>
&<html><body>
Header
<h4>Horizontal Header:</h4>
<table border="1">
<tr> <th>Name</th>
<th>Loan No</th>
<th>Amount</th> </tr>
<tr> <td>Jones</td>
<td>L-1</td>
<td>5000</td></tr> </table><br><br>
<h4>Vertical Header:</h4>
<table border="5">
<tr> <th>Name</th>
<td>Jones</td> </tr>
<tr> <th>Loan No</th>
<td>L-1</td> </tr>
<tr> <th>Amount</th>
<td>5000</td></tr> </table>
</body></html>
Table Code with Colspan
& Rowspan
<html><body>
<h4>Cell that spans two columns:</h4>
<table border="4">
<tr> <th>Name</th>
<th colspan="2">Loan No</th> </tr>
<tr> <td>Jones</td>
<td>L-1</td>
<td>L-2</td> </tr> </table>
<h4>Cell that spans two rows:</h4>
<table border="8">
<tr> <th>Name</th>
<td>Jones</td></tr><tr>
<th rowspan="2">Loan No</th>
<td>L-1</td></tr><tr>
<td>L-2</td></tr></table>
</body></html>
Table Code with Caption
& ColSpacing
<html>
<body>
<table border="1">
<caption>My Caption</caption>
<tr>
<td>Milk</td>
<td>Tea</td>
</tr>
<tr>
<td></td>
<td>Coffee</td>
</tr>
</table>
</body>
</html>
Cellpadding,Image &
Backcolor Code
<html><body>
<h3>Without cellpadding:</h3>
<table border="2" bgcolor="green">
<tr> <td>Jones</td>
<td>Smith</td></tr>
<tr> <td>Hayes</td>
<td>Jackson</td></tr></table>
<h4>With cellpadding:</h4>
<table border="8"
cellpadding="10"
background="file:///C:/WINDOWS/Feath
erTexture.bmp">
<tr> <td>Jones</td>
<td>Smith</td></tr>
<tr> <td>Hayes</td>
<td>Jackson</td></tr></table>
</body></html>
HTML List Tag
Lists provide methods to show item or
element sequences in document content.
There are three main types of lists:->
The syntax:-
<form>
.
input elements
.
</form>
<form>
Form Tags
Defines a form for user input
<input> used to create an input field
<text> Creates a single line text entry field
<textarea> Defines a text-area (a multi-line text input
control)
<password> Creates a single line text entry field. And
the characters entered are shown as
asterisks (*)
<label> Defines a label to a control
<option> Creates a Radio Button.
<select> Defines a selectable list (a drop-down box)