Web Tech: Assignment
Web Tech: Assignment
Web Tech: Assignment
WEB TECH
ASSIGNMENT
- DIVYA UDAYAN
18BIT0195
1) Introduction to HTML
CODE:
<HTML>
<HEAD>
<TITLE>Welcome </TITLE>
</HEAD>
<BODY>
</BODY>
</HTML>
1
CODE:
<html>
<body>
1 2 3 4 5 6 7 8 9 10
</body>
</html>
CODE:
<html>
<head>
<title>This is a webpage</title>
</head>
<body>
</p>
</body>
2
</html>
d. Create a webpage that prints the message "When was this webpage created?Check page's title for the
answer." to the screen, and set the title of the page to the current date.
Code:
<html>
<head>
</head>
<body>
<!--print a message-->
</body>
</html>
3
e. Create a webpage that prints any text of your choice to the screen; do not
f. Create a webpage which keeps track of the browsers information and do the following
CODE:
<html>
<head>
</head>
<body>
<p>Hello to HTML</p>
</body>
</html>
4
2
HTML TEXT EXERCISES
5
Code:
<html>
<body>
<font face="Tahoma">abc</font>
</body>
</html>
Code:
<html>
<body>
<font face="ariel"><b><U>Under</U></b><BR></font>
</body>
6
</html>
Code:
<html>
<body>
<p>
</font>
</font>
<font face="Helvetica">
HTML tags label pieces of content such as "heading", "paragraph", "table", and so on
Browsers do not display the HTML tags, but use them to render the content of the page
7
</font>
<font face="Georgia">
HTML is used to specify the way webpages look, not how they
function.
</font>
</p>
</body>
</html>
f. Print a paragraph that is a description of a book; include the title of the book as well
as its author. Names and titles should be underlined, adjectives should be italicized
and bolded.
CODE:
<html>
<body>
8
<p>
A book which is worth reading is <u>The hope</u> by <u>RISHI RAJ</u>. This book is about a life
who begins arranging his ways in life when some thing unusal
occurs within his firm. Consequently, he becomes acquainted with the inner city streets, and
realizes the harsh existence of the homeless, and vows to give them a chance in the life. <u>The
Hope</u> is a <b><i>great</i></b>
</p>
</body>
</html>
g. Print your name to the screen with every letter being a different heading size.
CODE:
<html>
<body>
<h5>R</h5>
<h4>I</h4>
9
<h3>S</h3>
<h2>H</h2>
<h1>I</h1>
</body>
</html>
h. Write a comment line on your code and make sure it is not displayed in the page
CODE:
<html>
<body>
10
</body>
</html>
i. Print a2+b2=2ab
j. Print H2O
<html>
<head>
</head>
<body>
<p>a<sup>2</sup>+b<sup>2</sup>=2ab</p>
11
</body>
</html>
Code:
<html>
<head>
</head>
<body>
#include<stdio.h> <br>
int main()<br>
{
<p>printf("Hello, World!");</p>
12
<p>return 0;</p>
}<br>
</body><br>
</html>
13
n. Set the font size as 10. Print it. Again try to decrease the font size. Check whether
CODE:
<HTML>
<HEAD>
<TITLE>Welcome </TITLE>
</HEAD>
<BODY bgcolor="yellow">
</body>
</HTML>
14
CODE:
15
a. Print the squares of the numbers 1 - 20. Each number should be on a separate line,
Code:
<html>
<body>
1<sup>2</sup> = 1
<br />
2<sup>2</sup> = 4
<br />
3<sup>2</sup> = 9
<br />
4<sup>2</sup> = 16
<br />
5<sup>2</sup> = 25
<br />
6<sup>2</sup> = 36
<br />
7<sup>2</sup> = 49
16
<br />
8<sup>2</sup> = 64
<br />
9<sup>2</sup> = 81
<br />
10<sup>2</sup> = 100
<br />
11<sup>2</sup> = 121
<br />
12<sup>2</sup> = 144
<br />
13<sup>2</sup> = 169
<br />
14<sup>2</sup> = 196
<br />
15<sup>2</sup> = 225
<br />
16<sup>2</sup> = 256
<br />
17<sup>2</sup> = 289
<br />
18<sup>2</sup> = 324
<br />
19<sup>2</sup> = 361
17
<br />
20<sup>2</sup> = 400
</body>
</html>
b. Prints 10 names with a line break between each name. The list should be
alphabetized, and to do this place a subscripted number next to each name based on
where it will go in the alphabetized list. (Example: Alan1). Print first, the
unalphabetized list with a subscript number next to each name, then the
18
Code:
<html>
<body>
<h1>Unalphabetized list</h1>
Boby<sub>3</sub>
<br />
Ram<sub>5</sub>
<br />
Sundra<sub>6</sub>
<br />
Sita<sub>7</sub>
<br />
Wasim<sub>10</sub>
<br />
Thakur<sub>8</sub>
<br />
Wazib<sub>9</sub>
<br />
Jaan<sub>4</sub>
<br />
Aman<sub>1</sub>
<br />
Anna<sub>2</sub>
19
<h1>Alphabetized list</h1>
Aman
<br />
Anna
<br />
Boby
<br />
Jaan
<br />
Ram
<br />
Sundar
<br />
Sita
<br />
Thakur
<br />
Wasim
<br />
Wazib
</body>
</html>
20
c. Print two lists with any information you want. One list should be an ordered list,
code:
<html>
<body>
<b>Hardware </b>
<ol type="I">
<li>monitor</li>
<li>mouse</li>
<li>Hard disk</li>
21
<li>cpu</li>
</ol>
<b>Software</b>
<ul type="square">
<li>utorrent</li>
<li>chrome</li>
<li>cpp</li>
<li>microsoft office</li>
</ul>
</body>
</html>
22
<html>
<body>
<b>beverage </b>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
</body>
</html>
23
Below the horizontal line print a paragraph relating to the text in the heading.
Code:
<html>
<body>
<h1>Biscuit</h1>
<p>
Porcelain or other pottery which has been fired but not glazed.
"biscuit ware".
</p>
</body>
</html>
24
<html>
<body>
<dl>
<dt>Cpp</dt>
<dt>Hammer</dt>
<dd>A tool</dd>
<dt>Tomato</dt>
<dd>A vegetable</dd>
<dt>Technology</dt>
certain objectives</dd>
<dt>Megabyte</dt>
25
</dl>
</body>
</html>
g. Print two addresses in the same format used on the front of envelopes (senders
Code;
<html>
<body>
<address>
26
</address>
<center>
<address>
Shubhum<br />
</address>
</center>
</body>
</html>
27
h. Print ten acronyms and abbreviations of your choosing, each separated by two
lines. Specify the data that the abbreviations and acronyms represent
Code:
<html>
<body>
<abbr title="Abstract">Abstr.</abbr>
<abbr title="Biochemistry">Biochem.</abbr>
<abbr title="Example">Ex.</abbr>
<abbr title="Literature">Lit.</abbr>
28
<abbr title="Mathematics">Math.</abbr>
ISO
</acronym>
</acronym>
<p>
</p>
</body>
</html>
29
a. Display five different images. Skip two lines between each image. Each image
Code:
<html>
<head>
<title>Five images</title>
</head>
<body>
30
</body> </html>
31
b. Display an image that has a border of size 2, a width of 200, and a height of 200.
32
5.
Code:
<html>
<head>
<style>
table {
width: 100%;
}
td, th {
33
padding: 8px;
}
{
background-color: #dddddd;
}
</style>
</head>
<body>
<h2>HTML Table</h2>
<tr>
</tr>
<tr>
<th>Item Discription</th>
<th>Price</th>
</tr>
<tr>
<th>Shipping handle</th>
<th>Expense</th>
34
</tr>
<tr>
<th rowspan="2">1</th>
<td rowspan="2">pic</td>
<td>$400.00</td>
</tr>
<tr>
<td>$20.00</td>
</tr>
<tr>
<th rowspan="2">2</th>
<td rowspan="2">pic2</td>
<td>$50</td>
</tr>
<tr>
<td>$14.00</td>
</tr>
<tr>
</table>
35
</body>
</html>
36
6.
<html>
<head>
<title>Document</title>
</head>
<style>
body {
padding: 0;
margin: 0;
height: 100%;
}
</style>
<body>
37
<div class="main" style=" width: 35%; margin-left: 32.5%; margin-top: 5%; border: 2px solid
black; ">
</div>
<form>
<div>
</div>
</div>
</div>
</div>
<p style="display: inline-block; vertical-align: top; margin-left: 34%;">How may pieces of
fruit <br>do you eat par day?</p>
38
<div>
<label for="0">0</label>
</div>
<div>
<label for="1">1</label>
</div>
<div>
<label for="2">2</label>
</div>
<div>
</div>
</div>
<br>
<ul style="list-style: none; overflow-y: scroll; border: 1px solid black; padding: 5%;
overflow-x: hidden;">
<li>Apple</li>
39
<li>Banana</li>
<li>Plum</li>
<li>Pomegranate</li>
</ul>
</div>
<br>
<p style="display: inline-block; margin-left: 37%; margin-top: 0%;">Would you like a <br>
            brochure?</p>
<br>
</form>
</div>
</body>
</html>
40
7HTML Frames.
41
Code:
a) <html>
<head>
<title>Amazon</title>
</head>
<body bgcolor="lightblue">
<header>
42
</header>
</body>
</html>
b)<html>
<body background="7a.jpg">
<div class="menu">
<ul>
<h1><li><a href="#">PAYMENT</a></li></h1>
</ul>
</div>
<div class="profile">
</body>
</hmtl>
c)
<html>
<body background="shadow.png">
<div class="horizontal-line"></div>
43
<tr>
<th>S.no</th>
<th>User<br>name</th>
<th>DOB</th>
<th>Address</th>
<th>Occupation</th>
</tr>
<tr>
<td>1</td>
<td>Ramu.P</td>
<td>12th Jan<br>1980</td>
<td>H.No:22/12/1,M.G.Road,Vij.</td>
<td>Engineer</td>
</tr>
<tr>
<td>2</td>
<td>Mohan.R</td>
<td>23rd May<br>1982</td>
<td>H.No:22/12/11,patel<br>Road,Hyd.</td>
<td>Driver</td>
</tr>
<tr>
<td>3</td>
44
<td>Pavani.V</td>
<td>27th July<br>1983</td>
<td>H.No:12/25,Ameerpet,Hyd.</td>
<td>Software<br>Engineer</td>
</tr>
<tr>
<td>4</td>
<td>Seshu.D</td>
<td>07th March<br>1984</td>
<td>H.No:1/99,S.R.Nagar,Hyd.</td>
<td>DBA</td>
</tr>
<tr>
<td>5</td>
<td>Surendra</td>
<td>29rd May<br>1982</td>
<td>H.No:22/12/11,Bala<br>Nagar,Hyd.</td>
<td>Professor</td>
</tr>
</table>
</body>
</html>
d)<html>
45
</frameset>
</html>
46
8) Create an external style sheet named as “external.css” and provide some styles for h2, p
and body tags. Create an html file named as “welcome.html” and link the external style
sheet. Include internal style sheet for body tags. Include a <p> tags with inline style sheet.
Code:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Document</title>
</head>
<style>
body{
47
margin: 0;
padding: 0;
height: 100%;
}
img{
height: 100%;
}
.container{
width: 60%;
margin-left: 35%;
margin-top: 5%;
}
.container .main{
padding: 2%;
}
text-transform: capitalize;
font-size: 200%;
48
font-weight: 900;
}
</style>
<body>
<img src="owl.PNG">
</div>
<div class="container">
<div class="main">
<h2>hello world!</h2>
Lorem ipsum dolor, sit amet consectetur adipisicing elit. Ex ducimus earum, ea
quisquam aliquid dicta possimus ratione commodi voluptate reprehenderit ipsum vel neque esse
illum! Voluptate facere magni dolorum molestias!
</p>
</div>
<p style="padding: 1%; border-top: 2px dotted black; border-bottom: 2px dashed black;
border-left: 2px solid black; border-right: 2px solid black;">Lorem ipsum dolor sit amet
consectetur adipisicing elit.</p>
</div>
49
</body>
</html>
50
9) Write the CSS code necessary to recreate the following appearance on-screen, exactly as
shown.
< html>
<head>
<title>Document</title>
</head>
<style>
body{
margin: 0;
padding: 2% 7.5% ;
background: #666262;
}
.container{
padding: 20px;
background: #ffffff;
}
.main-heading{
text-align: center;
}
.nav-bar{
51
margin: 4% 0;
}
.nav-bar a{
text-decoration: none;
color: white;
background: #000000;
padding: 0 20px;
margin-right: 3px;
}
display: inline-block;
vertical-align: top;
}
.rating{
background: green;
color: white;
font-size: 30pt;
padding: 20px;
margin: 5px;
}
.metascore{
width: 50%;
}
</style>
52
<body>
<div class="container">
<h1 class="main-heading">WALL-E</h1>
<nav class="nav-bar">
<a href="#">Summary</a>
</nav>
<div class="poster-image">
</div>
<div class="rating">
<p>33</p>
</div>
<div class="metascore">
<h2>Metascore</h2>
<ul>
53
<li>Summary: After hundreds of linely years of doing what he<br>was built for, Wall-E
discovers a new purpose in life when<br>he meets a sleek search robot namved EVE. [Walt
Disney<br>Pictures]</li>
</ul>
</div>
</div>
</body>
</html>
54
10) Design the following web page using HTML5 and CSS:
Code:
Html
<html>
<head>
<title>Document</title>
</head>
<body>
<div class="container">
<header>
<div class="logo">
<p>Travel diaries</p>
</div>
<nav>
<a href="#">HOME</a>
<a href="#">BLOG</a>
<a href="#">RESUME</a>
<a href="#">CONTACT</a>
</nav>
</header>
55
<div class="banner">
<div>
</div>
</div>
<section class="main-content">
<article class="main-paragraph">
<div>
</div>
<p>
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Eius voluptates perferendis voluptatum, asperiores
iusto architecto aliquid. Aliquam nam nulla accusamus molestiae cum, molestias magnam quos ipsam debitis rem.
Voluptatem, fuga.
Lorem ipsum dolor sit amet consectetur, adipisicing elit. Eos necessitatibus eius iusto beatae, deserunt officia
soluta est alias velit totam nemo ipsa odio voluptatem! Porro, sapiente tempora. Illum, doloribus fugiat?
</p>
<p>
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Perferendis soluta numquam quia et, quibusdam
reprehenderit obcaecati aliquid dolore laborum quidem odit minus porro iusto unde laudantium minima sunt doloribus
atque!
Lorem ipsum dolor, sit amet consectetur adipisicing elit. Molestiae magnam voluptates at facilis numquam,
non officiis incidunt aspernatur similique veniam deserunt, autem ut doloremque exercitationem neque reprehenderit.
Illum, placeat perspiciatis!
Lorem ipsum dolor sit amet consectetur adipisicing elit. Neque corporis aperiam recusandae voluptatibus
iusto ex doloribus optio, ratione nisi, ducimus sunt temporibus, harum asperiores impedit quidem eos minus facere
consectetur?
56
</p>
<p>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Omnis error asperiores suscipit dicta sequi dolorem
dignissimos aliquam, harum quos repellendus culpa quibusdam ipsam unde consequuntur assumenda eum tempore
sint quis.
Lorem ipsum dolor sit amet consectetur adipisicing elit. Similique accusantium velit adipisci vero
necessitatibus, et laborum perferendis ullam nam repellendus optio labore consequuntur iste cum rem architecto
recusandae excepturi inventore.
Lorem ipsum dolor sit amet consectetur adipisicing elit. Libero eveniet ad tempora iusto qui vel hic officia
minus excepturi! Quae ea minima perferendis maiores placeat impedit esse voluptates minus saepe.
</p>
</article>
<aside class="about-author">
<div class="about">
<p>
Let me introduce myself: My name's Zozor, I was born Novermber 23rd 2005
A bit meager, is it not? This is why I've now decided to write my biography to let my readers know who I
really am.
</p>
57
</p>
</div>
</aside>
</section>
<footer>
<div class="tweet">
Hee-haw!
<br>
<br>
<br>
12/05 23:12
</div>
<div class="images">
<h2>MY PICTURES</h2>
<p>
</p>
</div>
<div class="friends">
58
<h2>MY FRIENDS</h2>
<ul>
<li>mr boabob</li>
<li>kaiwaii</li>
<li>perveval. eu</li>
</ul>
<ul>
<li>Ji</li>
<li>Super Cucumber</li>
<li>Prince</li>
<li>Mr Fan</li>
</ul>
</div>
</footer>
</div>
</body>
</html>
Css
html{
59
}
header{
padding: 1%;
border-radius: 20px;
}
.logo{
display: inline-block;
}
margin: 0%;
}
nav{
display: inline-block;
border-radius: 20px;
padding: 1%;
margin-left: 65%;
}
nav a{
text-decoration: none;
60
color: #000000;
margin-right: 10px;
}
.banner{
background: url("sanfrancisco.jpg");
background-size: cover;
height: 205px;
padding-top: 1px;
margin-top: 5px;
border-radius: 20px;
}
.banner div{
height: 50px;
width: 100%;
background: rgba(0,0,0,0.5);
margin-top: 150px;
}
display: inline-block;
color: white;
margin-left: 2px;
}
61
margin-left: 70%;
background: red;
border-radius: 5px;
height: 70%;
}
.main-content{
margin-top: 20px;
border-radius: 20px;
padding: 1%;
}
.main-paragraph , .about-author{
display: inline-block;
vertical-align: top;
text-align: justify
}
float: left;
margin-right: 10px;
margin-bottom: 0;
}
62
.main-paragraph{
width: 70%;
margin-right: 15px;
padding: 1%;
border-radius: 20px;
}
.about-author{
position: relative;
width: 24.5%;
background-color: #797878;
border-radius: 20px;
padding-bottom: 0%;
padding-left: 0.5%;
padding-right: 0.5%;
}
.about-author h3{
text-align: center;
}
.about-author img{
margin-left: 30%;
63
}
footer{
border-radius: 20px;
margin-top: 10px;
padding: 0.5%;
}
display: inline-block;
vertical-align: top;
width: 32.25%;
}
.tweet{
border-radius: 20px;
padding: 0.5%;
}
.tweet h2{
text-align: center;
}
.images{
text-align: center;
64
border-radius: 20px;
padding: 0%;
}
margin: 4px;
}
.images img{
width: 24%;
}
.friends{
text-align: center;
border-radius: 20px;
}
.friends ul{
display: inline-block;
list-style: none;
text-align: left;
margin: 1.75%;
}
65
66
67