HTML PDF
HTML PDF
Advantages of HTML
• For creating html document you need only text editor. No special software is
required.
Eg:- notepad.
• Html is platform independent means html document can be created on any
hardware.
• Finding error is easy in html.
• Html does not cost you anything for its use.
• There are no expensive licenses to buy or no upgrades to purchase.
• You can work independently.
• You need not to worry about editing programs.
• You will have a much better concept of the structure of your page and
understanding of why it works.
• Learning html is simple than any other programming language.
Disadvantages of HTML
• Html is not a programming language.
• Any simple calculation cannot be done in html.
• It cannot display even date.
• Also interactive web pages cannot be built by html.
• The web pages developed in html cannot behave like an application.
• The web pages developed in html do not have their own interface.
• Hyper link provided in html but for that we need a trip to server at each step.
Tag
• It is unit of markup.
• It is set of symbols defines in html to have special meaning.
• Html tags start with a less than sign(<) followed by keywords and ends with greater
than sign(>).
These symbols are also called as angle bracket.
• The tags are not displayed in web browser but their effect is displayed.
Syntax:- <keyword>
Eg:- <html>
• There are two types of tags
1. Start tag
2. End tag
1. Start tag:-
It is used to start an effect of tag. Eg:- <html>
2. End tag:-
End tag repeat the keyword with forward slash(/). It is used to end an effect of tag.
Eg:- </html>
Nesting of tags
Nesting of tag means tag within tag. Tags can be nested within each other.
Eg:- <b><i>computer science</i></b>
In above example observe that italic tag completely within bold tag.
Tag Attribute
Attribute is a keyword separated by a space within angle bracket.
It affect on behavior of tag.
Eg:- <hr no shade>
Some attributes require a value preceded by an equal sign.
Eg:- <p align=”left”>
• Attributes
1. align:-
It allows you to specify where the text or data appear on screen.
There are three alignments left, center and right.
Eg:- <p align=”right”>computer science</p>
O/P:-
computer science
Tulip flower
Eg:- <img src=”C:\Users\Public\Pictures\SamplePictures\Tulips.jpg”><br clear
all>Tulip flower.
O/P:-
Tulip flower
➢ <hr> tag (horizontal rule)
It is used to divide the web page into separate sections.
It does not have closing or ending tag.
Eg:- <p>this is first line<hr>this is second line</p>
O/P:-
this is first line
Computer Science
Computer Science
Computer Science
• Attributes
1. align:-
It allows you to specify where the heading appears on screen.
There are four alignments left, center, right and justify.
Eg:- <h5 align=”left”>computer science</h5>
O/P:- Computer Science
O/P:-
Personal Information
Name: Utkarsh Jadahv
Address: Aurangabad
Contact No.: 8080808080
Date of Birth:21 April
utkarshj@gmail.com
➢ List tags
There are three types of list in html.
1. Unordered list
2. Ordered list
3. Definition list
• Attribute
1. type:-
It allows you to specify type of bullet.
There are three types of bullet disc (•), circle (°) and square (∎).
Eg:- <ul type=”circle”>
<li>monitor
<li>printer
<li>speaker
</ul>
O/P:-
o monitor
o printer
o speaker
• Attribute
1. type:-
It allows you to specify type of number.
There are following types of numbers:
type=”1” (Numbers)
type=”I” (Arabic numbers)
type=”i” (Lower case Roman numbers)
type=”I” (Upper case Roman numbers)
type=”a” (Lower case alphanumeric)
type=”A” (Upper case alphanumeric)
2. start:-
It allows you to specify beginning of lists number sequence.
Eg:- <ol start=”3”>
<li>monitor
<li>printer
<li>speaker
</ol>
O/P:-
3. monitor
4. printer
5. speaker
• Attribute of <li> tag with ordered list.
1. value:-
It allows you to specify a certain number to a particular list item.
Eg:- <ol>
<li>monitor
<li>printer
<li value=”10”>speaker
</ol>
O/P:-
1. monitor
2. printer
10. speaker
Breakfast menu---------h4
• Bread
• Cheese
• Eggs
• milk
<html>
<head>
<title>title</title>
</head>
<body>
<h4>breakfast menu</h4>
<ul type=”disc”>
<li>bread
<li>cheese
<li>eggs
<li>milk
</ul>
</body>
</html>
Breakfast menu---------h4
• Bread
o Milk bread
o Brown bread
• milk
<html>
<head>
<title>title</title>
</head>
<body>
<h4>breakfast menu</h4>
<ul type=”disc”>
<li>bread
<ul type=”disc”>
<li>milk bread
<li>brown bread
</ul>
<li>milk
</ul>
</body>
</html>
Output devices
7. monitor
8. printer
9. speaker
<html>
<head>
<title>title</title>
</head>
<body>
<b><u>Input devices</u></b>
<ol type=”a”>
<li>mouse
<li>keyboard
<li>scanners
</ol>
<hr>
<ol start=”7”>
<li>monitor
<li>printer
<li>speaker
</ol>
</body>
</html>
<html>
<head>
<title>title</title>
</head>
<body>
<b><u>Input/Output devices</u></b>
<ol type=”a”>
<li>mouse
<li>keyboard
<li>scanners
</ol>
<ol>
<li>monitor
<li>printer
<li>speaker
</ol>
</body>
</html>
• Attributes.
1. size:-
It allows you to specify size of the data ranging from +1 to +7.
+7 size is displayed in larger and bolder font than other sizes and +1 size is
displayed in smaller font than other sizes.
Eg:- <font size=”+1”>computer science</font>
O/P:-
computer science
2. face:-
It allows you to specify typeface of the data.
We can use single typeface from list of typefaces, such as arial, cambria, etc.
Eg:- <font face=”arial”>computer science</font>
O/P:-
computer science
Also you can use more than one typeface from list of typefaces separated by
commas. The available available typeface will be used to display and if font face
is not available the face will appear.
Eg:- <font face=”arial,cambria”>computer science</font>
O/P:-
computer science
3. color:-
It allows you to specify color to the data.
We can use RGB value of color or color name.
Eg:- <font color=”red”>computer science</font>
O/P:-
computer science
2. target:-
As linked web page displayed in same browser, original contents of the browser
disappears. In such a case we can use target attribute.
It is used to display linked web page in another frame or new tab.
Eg:- <a href=”E:\12thcs\next.html” target=”anotherframe”>next_page</a>
3. name:-
It is used create links within the same page.
Eg:- <a href=”#address”>address</a>
3. text
It is used to specify color to the text of body section.
Eg:- <body text=”yellow”>
4. link
It is used to specify color to the links.
Eg:- <body link=”red”>
5. alink
It is used to specify color of active links.
Eg:- <body alink=”olive”>
6. vlink
It is used to specify color of visited links.
Eg:- <body vlink=”maroon”>
• Attributes
1. src (source) :-
It is used to give path or address of image. It is compulsory attribute of image
tag.
Eg:- <img src=”C:\Users\Public\Pictures\SamplePictures\Tulips.jpg”>
2. border :-
It is used to give border to the image.
Eg:- <img src=”C:\Users\Public\Pictures\SamplePictures\Tulips.jpg”
border=”1”>
O/P:-
3. alt :-
It is used to give alternate text to the image tag and it displays when roll mouse
over the image. Sometime it uses instead of image.
Eg:- <img src=”C:\Users\Public\Pictures\SamplePictures\Tulips.jpg” alt=”Tulip
Flowers”>
O/P:-
4. align :-
It is used to align image over the web page.
There are three vertical alignments top, middle and bottom and
two horizontal alignments used to float images that are left and right.
Eg:- <img src=”C:\Users\Public\Pictures\SamplePictures\Tulips.jpg”
align=”top”>
5. height :-
It is used to specify height of image. It is given in number of pixel.
Eg:- <img src=”C:\Users\Public\Pictures\SamplePictures\Tulips.jpg”
height=”500”>
O/P:-
6. width :-
It is used to specify width of image. It is given in number of pixel.
Eg:- <img src=”C:\Users\Public\Pictures\SamplePictures\Tulips.jpg”
width=”500”>
O/P:-
• Image formats
1. GIF (Graphic Interchange Format)
2. PNG (Portable Network Graphic)
3. JPEG (Joint Photographic Expert Group)
• Attributes
1. border
It is used specify border to the table.
Eg:- 1. <table> 2. <table border=”1”>
O/P:- 1 2 1 2
3 4 3 4
2. align
It is used to align the table horizontally.
There are three alignments left, center and right.
Eg:- <table align=”right”>
O/P:-
1 2
3 4
3. width
It is used to specify width of table.
Eg:- <table width=”30%”>
O/P:-
1 2
3 4
4. cellpadding
It is used to create space in between cell border and cell data.
Eg:- <table cellpadding=”3”>
O/P:-
1 2
3 4
5. cellspacing
It is used to create space in between each cell of the table.
Eg:- <table cellspacing=”3”>
O/P:-
1 2
3 4
O/P:-
Paper-I Paper-II Total
100 100 200
2. valign
It is used to align data of single row or single cell vertically.
There are three alignments top, middle, bottom and baseline.
Eg:- <tr align=”middle”>
<th align=” middle”>
<td align=” middle”>
O/P:-
100 100 200
3. bgcolor
It is used to specify color to single row or single cell.
Eg:- <tr bgcolor=”blue”>
<th bgcolor=”blue”>
<td bgcolor=”blue”>
O/P:-
100 100 200
2. colspan
It is used to merge columns or cells.
Eg:- <th colspan=”2”>
<td colspan=”2”>
O/P:-
CS Total
100 100 200
3. rowspan
It is used to merge rows or cells of different rows.
Eg:- <th rowspan=”2”>
<td rowspan=”2”>
O/P:-
Paper-I Paper-II Total
100 100 200
O/P:-
Total Paper-I Paper-II
200 100 100
O/P:- CS Marks
Computer Science
Paper-I Paper-II
100 100
Years
2017 2018 2019
Units 500 400 1000
Sales
Income 1000 800 2000
<html>
<head>
<title>table</title>
</head>
<body>
<table border=”1”>
<tr>
<th colspan=”2” rowspan=”2”></th>
<th colspan=”3”>Years</th>
</tr>
<tr>
<td>2017</td>
<td>2018</td>
<td>2019</td>
</tr>
<tr>
<th rowspan=”2”>Sales</th>
<th>Units</th>
<td align=”center”>500</td>
<td align=”center”>400</td>
<td align=”center”>1000</td>
</tr>
<tr>
<th>Income</th>
<td align=”center”>1000</td>
<td align=”center”>800</td>
<td align=”center”>2000</td>
</tr>
</table>
</body>
</html>
HSC/SSC Board
HSC SSC
<html>
<head>
<title>table</title>
</head>
<body>
<table border=”1”>
<tr>
<th colspan=”2”>HSC/SSC Board</th>
</tr>
<tr>
<th>HSC</th>
<th>SSC</th>
</tr>
</table>
</body>
</html>
Teamperature
City Wind
High Low
Aurangabd 30 20 South
Jalna 32 21 South
Parbhani 35 22 West
Weather’s Report
<html>
<head>
<title>table</title>
</head>
<body>
<table border=”1”>
<tr>
<th rowspan=”2”>City</th>
<th colspan=”2”>Temperature</th>
<th rowspan=”2”>Wind</th>
</tr>
<tr>
<th>High</th>
<th>Low</th>
</tr>
<tr>
<td align=”left”>Aurangabd</td>
<td align=”center”>30</td>
<td align=”center”>20</td>
<td align=”left”>South</td>
</tr>
<tr>
<td align=”left”>Jalna</td>
<td align=”center”>32</td>
<td align=”center”>21</td>
<td align=”left”>South</td>
</tr>
<tr>
<td align=”left”>Parbhani</td>
<td align=”center”>35</td>
<td align=”center”>22</td>
<td align=”left”>West</td>
</tr>
<caption aligh=”bottom”><b><u>Weather’s Report</u></b></caption>
</table>
</body>
</html>
VB Script
➢ <script> tag
It is used to add script code in html web page.
It can be written in head section as well as body section.
Eg:- <script language =”VBScript”>
Scripting code
</script>
Q. Write html code for displaying time and day. Make use of VB script.
<html>
<head>
<title>VBScript Code</title>
</head>
<body>
<script language =”VBScript”>
document.write(“Today’s Date is:”)
document.write(MonthName(Month(Now) & “/” & Day(Now) & “/” & Year(Now))
document.write(“The Time is:”)
document.write(“Time())
</script>
</body>
</html>
O/P:-
Today’s Date is: 11/7/2020
The time is: 9:35:56 AM
Note:- Above program shows current system date and time as a output.
Q. Write html code for displaying time and day. Make use of VB script.
<html>
<head>
<title>VBScript Code</title>
<script language =”VBScript”>
document.fgcolor=”h FF0000”
document.bgcolor=”h 00FF00”
msg box “Welcome to VBScript”
</script>
</head>
<body>
VBScript
</body>
</html>
O/P:-
---message box
Welcome to VBScript