CS606 SD
CS606 SD
2 Importance
16 Lab 13: Create an html file by applying the different styles using
inline, external & internal style sheets.
17 Lab 14: To create external style sheet and using the style sheet in xml file.
Introduction of Internet and Web designing
Internet is a collection of computers where many computers grouped together share their
information.
HTML is known as Hyper Text Markup Language. It is the main markup language that is
used for web pages. A markup language is a set of markup tags and HTML uses markup tags
to describe web pages.HTML is a layout of a document and the hyperlink specification
language. It is a language for describing web pages.
Web designing involves various factors. These factors decide the overall appeal of your
website. When you are making websites, you have to keep in mind various factors in terms
of look and feel, size, layout, color theme, graphics, compositions, typography,
downloading size, resolution, functionality and page layout. In this unit, you will learn all
the aspects that you have to keep in mind before you start designing your web pages and
start building your websites.
Importance
❖ HTML is important as the base language that CSS, JavaScript plug in to. It
provides the content that CSS styles, JavaScript enhances links to a database (to
simplify their functions).
❖ 99.9% of the time or so, web applications are outputting HTML/CSS/JavaScript to
the browser, so you need to understand them if you're going to output them, just
like you need to understand English if you are going to output text in English.
❖ If you want to possess a credible online presence that reflects your company and
provides a platform to contend with competent rivals HTML is the best language
for website creation. It's several benefits a number of them are:
▪ A significant benefit of HTML it is free of charge and no need to
install any software.
▪ HTML is simple to use and understand. and high-speed loading time.
▪ All browsers support HTML.
▪ Most development tools whatever they are paid or free all support
HTML.
▪ HTML and XML syntax is extremely similar.
Objective of Lab Manual
Solution:
<html>
<head><title> body and pre tag </title></head>
<body text="red" bgcolor="yellow" background="image.jpg"> This is an Illustration of body tag
with its properties
<pre>
This text uses pre tag and
preserves nextline and spaces
</pre>
This text doesnt uses pre tag so doesnt preserves nextline and spaces.. everything will be
printed in the same line
</body></html>
Output
Lab 2: Develop a Program to illustrate text Font tag
<html>
<title> Font tag Example </title>
<body><font face="arial" size="1" color="blue"> WELCOME </font><br><font size="2"
color="cyan"> WELCOME </font><br><font size="3" color="red"> WELCOME
</font><br><font size="4" color="yellow"> WELCOME </font><br><font size="5"
color="green"> WELCOME </font><br><font size="6" color="brown"> WELCOME
</font><br><font size="7" color="pink"> WELCOME </font><br><font size="20"
color="gray"> WELCOME </font><br>
</body></html>
Output
Lab 3: Develop a Program to illustrate comment,h1….h6, and div tag
<html>
<head><title> Illustrating comment, h1...h6 and div tags </title></head>
<body>
<!--THIS IS A COMMENT LINE -->
<div style="color:#00ff00"><h1 align="center"> This is h1 tag text with center aligned </h1><h2
align="left"> This is h2 tag text with left aligned </h2><h3 align="right">This is h3 tag text with
right aligned </h3></div>
<h4> This is h4 tag text without alignment</h4><h5> This is h5 tag Text without
alignment </h5><h6> This is h6 tag text without alignment </h6>
</body></html>
Output
Lab 4: Develop a Program to illustrate text formatting tags
<html>
<head><title> Text Tags </title></head><body><center><h1 align="center">To illustrate text
formatting tags </h1><hr color="red">
<P><marquee behavior="alternate"> This is an alternate Marquee text </marquee>
This is <i> italized </i></p>
This is <u> underlined </u></p>
This is <b> bold </b></p>
This is <em> emphasized </em></p><p>This is <Strong> Strong Text </strong></p>
This is <s> striked text </s></p>
This is <code> computer code </code></p>
This is <sup> superscript </sup> code </p>
This is <sub> subscript </sub> code </p>
This is <big> big text </big></p>
This is <small> small text </small></p></center>
</body></html>
Output
Lab 5: Develop a Program to illustrate Order List tag
<html>
<head>
<title> Order List tag </title>
</head>
<body>
<h3 align="center" style="color:red">To illustrate ORDER list tags</h3>
<hr COLOR="RED">
<h4>Numbered list:</h4>
<ol><li>Apples</li><li>Banana
s</li><li>Lemons</li><li>Oran
ges</li>
</ol>
<h4>Uppercase Letters list:</h4>
<ol
type="A"><li>Apples</li><li>
Bananas</li><li>Lemons</li><l
i>Oranges</li>
</ol>
<h4>Lowercase letters list:</h4>
<ol
type="a"><li>Apples</li><li>B
ananas</li><li>Lemons</li><li
>Oranges</li>
</ol>
<h4>Roman numbers list:</h4>
<ol
type="I"><li>Apples</li><li>B
ananas</li><li>Lemons</li><li
>Oranges</li></ol>
<h4>Lowercase Roman numbers list:</h4>
<ol
type="i"><li>Apples</li><li>Bananas</li><li>Lemons</li
><li>Oranges</li>
</ol>
</body></html>
Output
Lab 6: Develop a Program to illustrate Unordered List tag
Solution:
<html>
<title>Unordered List </title></head><body><h3 align="center">
To illustrate unordered list tags </h3><hr color="red">
<h4>Disc bullets list:</h4>
<ultype="disc"><li>Apples</li><li>Bananas</li>
<li>Lemons</li><li>Oranges</li>
</ul>
<h4>Circle bullets list:</h4>
<ul
type="circle"><li>Apples</li><li>Bananas</li><li
>Lemons</li><li>Oranges</li>
</ul>
<h4>Square bullets list:</h4>
<ul
type="square"><li>Apples</li><li>Bananas</li><li>
Lemons</li><li>Oranges</li>
</ul>
</body></html>
Output
Lab 7: Develop a program to illustrate Nested and Definition tag
Solution:
After Clicking On Click Me or the Flower image the output is After Clicking on the See also
<html>
<head><title> Table tag </title></head>
<body><center><h4>Table with border, vertical headers, cellpadding and cellspacing</h4>
<table border="1">
<tr> <th>Name</th> <th colspan="2">Telephone</th> </tr>
<tr> <td>Radha</td> <td>555 77 854</td> <td>555 77 855</td> </tr>
</table>
<table border="1">
<tr>
<th>First Name:</th>
<td>Radha</td></tr><tr>
<th rowspan="2">Telephone:</th>
<td>555 77 854</td></tr><tr>
<td>555 77 855</td>
</tr>
</table>
</center></body></html>
Output
Lab 10: Develop a Program to illustrate Frame tag
Solution:
mainframe.html
<html><head><title> Frame tag </title></head><head><frameset cols="20,60"><frame
src="f1.html"><frame src="f2.html" name="main"></frameset></frameset></head></html>
f1.html
<html><head><title> f1.html </title></head><body><h3> States of Gujarat </h3><a
href="ahmedabad.html" target="main"> Ahmedabad<br></a><a href="vadodara.html"
target="main"> Vadodara<br></a></body></html>
f2.html
<html><head><title> f2.html </title></head><body><h1> Click on any state to get a welcome
message </h2></body></html>
ahmedabad.html
<html><head><title> ahmedabad.html </title></head><body bgcolor="green"><h1> Welcome
to Ahmedabad </h1></body></html>
vadodara.html
<html><head><title> vadodara.html </title></head><body bgcolor="red"><h1> Welcome to
Vadodara </h1></body></html>
Output
<html>
<head><title> css demo </title><style type="text/css">
body { background-color:red;}
h1 { color:orange; text-align:center;}
p { font-family: "Times new roman "; font-size: 20px;}
</style></head>
<body><h1> CSS EXAMPLE </h1>
<p> This is a paragraph </p>
</body></html>
OUTPUT
Lab 13: Create an html file by applying the different styles using inline, external & internal
style sheets.
Procedure :-
1. Create a external style sheet named as “external_css.css” and provide some styles for h2, hr, p
& a tags.
2. Create an html file named as “Style_sheet.html”
a) Include the external style sheet with necessary tag.
b) Include the internal style sheet for body tags & also use class name, so that the style can
be applied for all tags.
c) include a <p> tags with inline style sheet.
Solution :-
1. Create a css file in a notepad & save it with the .css extension.
2. In notepad type the necessary code & save with the file name mentioned with .html extension.
<html>
<head>
<link rel="stylesheet" type="text/css" href="external_style.css" />
<style type="text/css">
body
{
margin-left:200px;
background:#5d9ab2 url('img_tree.png') no-repeat top left;
}
.container
{
text-align:center;
}
.center_div
{
border:1px solid gray;
margin-left:auto;
margin-right:auto;
width:90%;
background-color:#d0f0f6;
text-align:left;
padding:8px;
}
</style>
</head>
<body>
<div class="container">
<div class="center_div">
<h1>Hello World!</h1>
</div>
</div>
<p style="border-style:dotted solid dashed double">This is some text in a paragraph.</p>
<p style="border-style:dotted solid dashed">This is some text in a paragraph.</p>
<p style="border-style:dotted solid">This is some text in a paragraph.</p>
<p style="border-style:dotted">This is some text in a paragraph.</p>
<h2>This is a header 1</h2>
<hr />
<p>You can see that the style
sheet formats the text</p>
<p><a href="cd_catalog.xml" target="_blank">This is a link</a></p>
</body>
</html>
File Name: external_style.css
<style>
h2 {color:maroon; font-size:20pt}
hr {color:navy}
p {font-size:11pt; margin-left: 15px}
a:link {color:green}
a:visited {color:yellow}
a:hover {color:black}
a:active {color:blue}
</style>
Output:
Lab 14: To create external style sheet and using the style sheet in xml file. Procedure:
Create a style sheet named as cd_catalog.css and provide necessary style for the tags used in
cd_catalog.xml file
Create an xml file named as cd_catalog_css.xml and include the .css file created above.
Solution :-
In notepad type the necessary code & save with the file name mentioned with .xml extension.
CATALOG
{
background-color: #ffffff;
width: 100%;
}
CD
{
display: block;
margin-bottom: 30pt;
margin-left: 0;
}
TITLE
{
color: #FF0000;
font-size: 20pt;
}
ARTIST
{
color: #0000FF;
font-size: 20pt;
}
COUNTRY,PRICE,YEAR,COMPANY
{
display: block;
color: #000000;
margin-left: 20pt;
}
Output: