HTML For Buiggner
HTML For Buiggner
Markup:-means the process of taking ordinary text and adding extra symbols, such as editor’s proof reading symbols are
type of markup. Each of the symbol used for markup in HTML is command that tells the browser how to display the text.
HTML is one of the web designing language.
Advantages of HTML:-
Disadvantages of HTML
1. HTML is not a programming language, like C,C++,VB.
2. Any simple calculation can not be done in HTML.
3. It cannot be used to display even date.
4. the interactive web pages can not be built by HTML.
5. The web pages developed in HTML can not be behave like application.
6. The web pages developed in HTML can not have their own interface.
7. hyperlink provided in HTML. But for that we need a trip to server at each step.
Tags
A Tag is a special unit of markup. It is a set of symbols, define in HTML to have special meaning. Tag starts with a
less than sign(<)followed by a keyword and close with greater than sign(>). These symbol is called as angle
brackets.
There are two types of the tags in HTML
1. start tag
2. end tag.
Start tag is used to begin the effect and end tag is used to end the effect of tag.
Name of the end tag is same as start tag followed by forword slash(/) symbol.
Ex:-<I>hello</I>
This <I> tag displays word hello in italic format. </I> indicates the end of the effect.
Tag can be used in nested format.
Ex:- <B><I>hello</B></I>
In above example hello displays hello in bold as well as in italic format.
Structure of HTML web page
The primary part of the HTML document are denoted by <HTML>,<HEAD> and <BODY>tags. Each of these tags are
known as document structure tags.
<HTML>
<HEAD>
<TITLE>
Title of the document
</TITLE>
</HEAD>
<BODY>
Actual document
</BODY>
</HTML>
HTML document is devided into two section:
1. The <HEAD> Tag:-It is generally used for title of the page. To define head of the page add <HEAD> tag at the beginning
of the head and put </HEAD> at the end of the head.
2. the actual document of the page is inserted into the page is appear in between <BODY> and </BODY> tag.
1. <HTML>:-
This tag is used to indicate start of the html page, and </HTML> tag is used to indicate the end of the HTML page.
All other tags must reside within the <HTML> and</HTML> tag.
Ex :-
<html>
<body>
<h1>This is Page1</h1>
<p>This is some text.</p>
</body>
</html>
2. <HEAD>:-
This tag defines the header area of the page, which is not displayed within the page itself in the browser.
In the <HEAD> section <TITLE> tag is used to display title for the web page. </TITLE> tag is used to end this <TITLE>
tag. And </HEAD> is used to end the header section of the page.
Ex:-
<html>
<head>
<title>Title of the document</title>
</head>
<body>
The content of the document......
</body>
</html>
<BODY>:-
the actual document of the web page will be displayed in the browser will appear in the body section. The body section starts
with<BODY> tag and ends with </BODY> tag..
there are several operational attributes are used for this tag such as background image, change the font size, color, etc. it uses
graphics and multimedia attributes.
Ex:- <html>
<head>
<title>Title of the document</title>
</head>
<body>
The content of the document......
</body>
</html>
In the BODY of the document we can apply formatting like bold, italic, underline, background, text color, font etc.
1. <B>:- bold tag
This is bold tag. The text appearing between start <B> and end </B> will be displayed in bold letters.
3. <U>:-undeline tag
This tag is used for underline the text. The text appearing between start tag <U> and end tag </U> will appear underlined.
The text enclosed within starting tag <BIG> and ending tag </BIG> is displayed in large font.
If size is already large then, tag is ignored.
This tag is used to display text in smaller font. The text enclosed in <SMALL> and </SMALL> tag is displayed in smaller
font.
The text enclosed within the tags <STRIKE> and </STRIKE> have strike font effect.
Ex:- <STRIKE>this is strike tag</STRIKE>
Output:-This is strike tag
The text enclosed within <SUB> and </SUB> is displayed in subscript form.
9. <SUP>:- superscript tag.
The text enclosed within start tag <SUP> and end tag </SUP> will be displayed in superscript form.
Example of all these above tags.
<html>
<body>
This tag is used to insert headlines of six levels (H1, H2, H3, H4, H5, and H6)
<html>
<body>
<h1>This is heading 1</h1>
This is heading 1
<h2>This is heading 2</h2> This is heading 2
<h3>This is heading 3</h3>
<h4>This is heading 4</h4> This is heading 3
<h5>This is heading 5</h5> This is heading 4
<h6>This is heading 6</h6>
</body> This is heading 5
</html> This is heading 6
12.<BR>:- break line tag.
<html>
<body> To break
<p> lines
To break<br />lines<br />in a<br />paragraph,<br /> in a
use the br element.</p> paragraph,
</body>
</html>
use the br element.
<html>
<body>
<p>This is some text.</p> This is some text.
<hr >
<p>This is some text.</p> This is some text.
</body>
</html>
14. <PRE>:- preformat the text. The text appearing between start tag <PRE> and end tag </PRE> is displayed in
monospace form. This tag is used to position the characters. This tag displays the text in exactly same format as the character
and line spacing format defined in source HTML document.
<html>
<body> Text in a pre element
<pre> is displayed in a fixed-
Text in a pre element width
is displayed in a fixed-width font, and it preserves
font, and it preserves both spaces and
both spaces and line breaks
line breaks
</pre> The pre element is often used
<p>The pre element is often used to display computer code:</p> to display computer code:
<pre>for i = 1 to 10
print i
for i = 1 to 10
next i
print i
</pre>
next i
</body>
</html>
The text appearing between start tag <STRONG> and end tag </STRONG> will displayed in bold.
<html>
<body>
Emphasized text
<em>Emphasized text</em><br />
<strong>Strong text</strong><br /> Strong text
</body>
</html>
17. <MARQUEE>:-tag.
This tag is used to scroll the text and images on screen from right to left. The text written between start tag<MARQUEE>
and end tag </MARQUEE> will scroll the text on screen horizontally right to left.
There are three attributes used with <MARQUEE> bgcolor, height,width,BEHAVIOR,HSPACE,VSPACE
Ex:-<MARQUEE>computer science</MARQUEE>
The unorder list is a list of items that have no particular order or sequence.
The special tag <LI> is used to indicate actual list elements.
Unorder list is bullated lists. They can be preceded by one of the bullet styles like a closed circle (•) or open circle(Ο) or
square().
Ex:-
<html>
<body>
An Unordered List:
<h4>An Unordered List:</h4>
<ul type=”square”> Coffee
<li>Coffee Tea
<li>Tea Milk
<li>MilK
</ul>
</body>
</html>
<html>
<body> An Ordered List:
<h4>An Ordered List:</h4>
<ol type=”I” > 1. Coffee
<li>Coffee 2. Tea
<ol type=i>
<li>nest
3. Milk
<li>brue
</ol>
<li>Tea
<li>Milk
</ol>
</body></html>
The attribute used with ordered list are:-
Type=”A”(uppercase letters)
Type=”I”(uppercase roman letters)
Type=”a”(lowercase letters)
Type=”i”(lowercase roman letters)
Type=”1”(number)
<HREF>:-
The HREF attribute is used with <A> anchor tag. HREF refers to hypertext reference This attribute marks the anchor as the
start of a link to another document or resources or to a particular place in another document.
Ex:-
<A HREF=”http//www.rediff.com”> enter the Email ID </A>
in this above example “enter the Email ID “is the hyper text link to the web site indicated by URL specified. i.e. rediff.com
<html>
<body>
</body>
</html>
<html>
<body>
</body>
</html>
<table border="1">
<tr> How it looks in a browser:
<td>row 1, cell 1</td>
<td>row 1, cell 2</td>
row 1, cell 1 row 1, cell 2
</tr>
<tr> row 2, cell 1 row 2, cell 2
<td>row 2, cell 1</td>
<td>row 2, cell 2</td>
</tr>
</table>
<html>
<body>
<h4>Without cellspacing:</h4>
<table border="1"> Without cellspacing:
<tr>
<td>First</td>
<td>Row</td> First Row
</tr>
Second Row
<tr>
<td>Second</td>
<td>Row</td> With cellspacing:
</tr>
</table>
<h4>With cellspacing:</h4>
First Row
<table border="1" cellspacing="10">
<tr>
<td>First</td>
Second Row
<td>Row</td>
</tr>
<tr>
<td>Second</td>
<td>Row</td>
</tr></table></body></html>
3. COLSPAN and ROWSPAN are special attribute that can be used with <TH> and <TD> tags.
When one cell of the table span more than one row or column then attribute COLSPAN, ROWSPAN are used.
COLSPAN attribute can be used to make cell contents merge with another cell.
Ex:- This span two columns.
<TD COLSPAN=”2”>
<TH COLSPAN=”2”>
Ex:-The ROWSPAN attribute merge the rows.
<TD ROWSPAN=”2”>
<TH ROWSPAN=”2”>
<html>
<body> Cell that spans two columns:
<html>
<body>
<h4>Cell backgrounds:</h4> Cell backgrounds:
<table border="1">
<tr> First Row
<td bgcolor="red"><fontcolor="white">First</td>
<td bgcolor="aqua"> <font color="red"><b>Row</b></td> Second Row
</tr>
<tr>
<td
background="bgdesert.jpg">
Second</td>
<td >Row</td>
</tr>
</table>
/body>
</html>
<html>
<body><table width="400" border="1">
<tr> Money spent on.... January February
<th align="left">Money spent on....</th>
<th align="right">January</th> Clothes $241.10 $50.20
<th align="right">February</th> Make-Up $30.00 $44.45
</tr>
<tr> Food $730.40 $650.00
<td align="left">Clothes</td> Sum $1001.50 $744.65
<td align="right">$241.10</td>
<td align="right">$50.20</td>
</tr>
<tr>
<td align="left">Make-Up</td>
<td align="right">$30.00</td>
<td align="right">$44.45</td>
</tr>
<tr>
<td align="left">Food</td>
<td align="right">$730.40</td>
<td align="right">$650.00</td>
</tr>
<tr>
<th align="left">Sum</th>
<th align="right">$1001.50</th>
<th align="right">$744.65</th>
</tr></table></body></html>
<html>
<body> Without cellpadding:
<h4>Without cellpadding:</h4>
<table border="1"> First Row
<tr>
<td>First</td> Second Row
<td>Row</td>
</tr> With cellpadding:
<tr>
<td>Second</td>
<td>Row</td>
</tr></table> First Row
<h4>With cellpadding:</h4>
<table border="1" cellpadding="10">
<tr>
Second Row
<td>First</td>
<td>Row</td>
</tr>
<tr>
<td>Second</td>
<td>Row</td>
</tr></table></body></html>
VBSCRIPT allows web author to write small scripts, that will be executed on users browsers rather than on the server.
Another importance of the VBSCRIPT is increased functionality introduced to the web author in the form of applet, plug in,
active X-Control and objects. Each of these things can be used to add extra functions and interactivity to the web page.
<SCRIPT> tag:-
The VBSCRIPT can be placed in <SCRIPT> start tag and </SCRIPT> end tag.
It contains attribute LANGUAGE=”VBSCRIPT” as shown below.
<SCRIPT LANGUAGE=”VBScript”>
Scripting code
</SCRIPT>
When browser executes <SCRIPT> Tag, it calls VBScript interpreter to compile and executes the code.
The code is placed in event handler but procedures can also be included.
Scripting allows to take control of contents of a page and manipulate them with the program.
1. sample of Script
<html>
output:-
<body>
Scripts in the body section are executed when the page is loading
<script language="vbscript">
Document. Write ("Scripts in the body section are executed when the page is loading")
</script>
</body>
</html>
Q1. Write exact output of the following HTML code with font specifications in brackets(M2002)
<html>
<body>
<h1>LIST OF BOOKS</h1></hr> LIST OF BOOKS
<ul type=”disc”>
<li>How to solve it by computer
<li>HTML in easy steps How to solve it by computer
<li>C++ Programming HTML in easy steps
</ul> C++ Programming
<ol type=”1”>
<li>microprocessor programming 1. microprocessor programming
<li>Networking essentials
<li microcontrollers 2. Networking essentials
</ol> 3. microcontrollers
</body>
</html>
<html><head><title>yesterdays weather</title></head>
<body>
<table border=”2”><caption>Yesterdays Weather</caption>
<tr>
<th>City</th>
<th>High</th>
<th>Low</th>
<th>Wind</th> </tr>
<tr>
<td>Mumbai</td>
<td>33</td>
<td>24</td>
<td>West</td> </tr>
<tr>
<td>Pune</td>
<td>34</td>
<td>25</td>
<td>South</td> </tr>
<tr>
<td>Latur</td>
<td>32</td>
<td>20</td>
<td>South</td> </tr>
</table></body></html>
Q 3. Write the exact output of the following html code with font specification in brackets (Oct2003)
<html>
<title> Introduction</title>
COMPUTER SCIENCE
<body>
<h1><b>COMPUTER SCIENCE</b></h1>
<hr>
<u>SCHAUM’S OUTLINE SERIES</U>
<hr>
<h5>SEYMOUR LIPSCHUTZ</H5>
</BODY>
</html>
Q 4. write a html code using VBScript for designing a web page which greets “Good morning” if time is from 12:00am up to
12:00pm, else greets “Good Afternoon”.(M2004)
<html>
<head>
<script type="text/vbscript">
function greeting()
if time()>=#12:00:00AM# and time()<=#12:00:00PM# then
greeting="good morning"
elseif time()>=#1:00:00pM# and time()<=#04:00:00PM# then
greeting="good afternoon"
else
greeting="good night"
end if
end function
</script>
</head>
<body>
<script type="text/vbscript">
document.write("My favorite time is " & greeting())
</script>
</body>
</html>
<html><head><title>computer science</title></head>
<body>
<table border="3">
<tr width="100%">
<th rowspan="2" colspan="2" width="25%"> </th>
<th colspan="3" align="center" width="75%">year</th>
</tr>
<tr>
<th align="center">1999</th>
<th align="center">2000</th>
<th align="center">2001</th>
</tr>
<tr >
<th rowspan="2" width="12%" align="center">sales</th>
<th align="center">Units</th>
<td align="center">300</td>
<td align="center">750</td> year
<td align="center">1,200</td>
1999 2000 2001
</tr>
<tr> Units 300 750 1,200
<th align="center">Income</th> sales
<td align="center">3000</td> Income 3000 7500 12000
<td align="center">7500</td>
<td align="center">12000</td>
</tr></table></body></html>
Q 7Write html code for displaying web page containing a six celled table as shown below.
<html>
<head>
<title>celled table</title></head> sachin saurav laxman
<body> first second third
<table border=”2” cellspacing=”50”>
<tr>
<td>sachin</td>
<td>saurav</td>
<td>laxman</td>
</tr>
<tr>
<td>first</td>
<td>second</td>
<td>third</td>
</tr> </table></body></html>
<html><head><title>computer science</title></head>
<body><table border="3">
<tr width="100%"> SCIENCE
<th colspan="3" width="100%"> SCIENCE </th>
</tr> FY BSc SY BSc TY BSc
<tr>
<th align="center"> FY BSc </th>
300 100 25
<th align="center"> SY BSc </th> ARTS
<th align="center"> TY BSc </th>
</tr> FY BA SY BA TY BA
<tr> 200 150 40
<td align="center"> 300 </td>
<th align="center"> 100 </td> COMMERCE
<td align="center"> 25 </td> </tr>
<tr width="100%">
FY BCOM SY BCOM TY BCOM
<th colspan="3" width="100%"> ARTS </th></tr> 300 70 50
<tr>
<th align="center"> FY BA </th>
<th align="center"> SY BA </th>
<th align="center"> TY BA </th></tr>
<tr>
<td align="center"> 200 </td>
<th align="center"> 150 </td>
<td align="center"> 40 </td> </tr>
<tr width="100%">
<th colspan="3" width="100%"> COMMERCE </th></tr>
<tr>
<th align="center"> FY BCOM </th>
<th align="center"> SY BCOM </th>
<th align="center"> TY BCOM </th></tr>
<tr>
<td align="center"> 300 </td>
<td align="center"> 70 </td>
<td align="center"> 50 </td></tr></table></body></html>