Web Technology Laboratory Assignment 2 - SPPU
Web Technology Assignment 2
Implement a web page index.htm for any client website using following
- a. HTML syntax: heading tags, basic tags and attributes, frames, tables, images, lists, links for text and images, forms etc.
- b. Use of Internal CSS, Inline CSS, External CSS
Create Two Files : index.html & contact.html
Code For index.html
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HomePage</title>
<style>
body {
background: #000000;
font-size: 22px;
line-height: 32px;
color: #ffffff;
word-wrap: break-word !important;
font-family: "Open Sans", sans-serif;
}
h1 {
font-size: 60px;
text-align: center;
color: #fff;
}
h3 {
font-size: 30px;
text-align: center;
color: #fff;
}
h3 a {
color: #fff;
}
a {
color: #fff;
}
h1 {
margin-top: 100px;
text-align: center;
font-size: 60px;
font-family: "Bree Serif", "serif";
}
#container {
margin: 0 auto;
}
p {
text-align: center;
}
nav {
text-align: center;
background-color: #1e85a5;
}
rgb(184, 181, 25)rgb(25, 184, 25) nav ul {
padding: 0;
margin: 0;
list-style: none;
position: relative;
}
nav ul li {
display: inline-block;
background-color: #1e85a5;
}
nav a {
display: block;
padding: 0 10px;
color: #fff;
font-size: 20px;
line-height: 60px;
text-decoration: none;
}
nav a:hover {
background-color: #000000;
}
nav ul ul {
display: none;
position: absolute;
top: 60px;
}
nav ul li:hover>ul {
display: inherit;
}
nav ul ul li {
width: 170px;
float: none;
display: list-item;
position: relative;
}
nav ul ul ul li {
position: relative;
top: -60px;
left: 170px;
}
li>a:after {
content: " +";
}
li>a:only-child:after {
content: "";
}
button {
margin: auto;
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
background-color: #1e85a5;
max-width: 45%;
}
.abc {
display: inline-block;
}
a {
text-decoration: none;
}
.p{
text-align: left;
}
.all
{
margin-left:35px;
}
</style>
</head>
<body>
<div id="container">
<nav>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="contact.html">Contact Us</a></li>
<li><a href='https://www.narendradwivedi.org' target='_blank'>Website (External Link)</a></li>
</ul>
</nav>
<h1>Narendra Dwivedi</h1>
<p>Welcome. This Is My HomePage</p>
<center>
<div class='abc'>
<button onclick="window.open('https://www.narendradwivedi.org','_blank');">Website (External Link)</button>
<button onclick="window.open('contact.html','_self');">Contact Us Page</button>
</div>
<p></p>
<a href='index.html'><img src='homepage_logo.png' style='height:25%;width:25%' alt='Homepage Image'></a>
</center>
</div><br><br>
<div class="all">
<table border='1' bordercolor='yellow' align='center'>
<tr>
<th>Name</th>
<th>Roll</th>
</tr>
<tr>
<td>Narendra</td>
<td>01</td>
</tr>
<tr>
<td>Ankit</td>
<td>02</td>
</tr>
</table>
<p class="p">Ordered List</p><ol>
<li>Hi</li>
<li>Hello</li>
</ol>
<p class="p">Unordered List</p>
<ul>
<li>Hi</li>
<li>Hello</li>
</ul>
</div>
</body>
</html>
Code For contact.html
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Contact Page</title>
<link rel='stylesheet' href='style.css'>
</head>
<body>
<div id="container">
<nav>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="contact.html">Contact Us</a></li>
<li><a href='https://www.narendradwivedi.org' target='_blank'>Website (External Link)</a></li>
</ul>
</nav>
<h1>Narendra Dwivedi</h1>
<p>Welcome. This Is Contact Page</p>
<center>
<div class='abc'>
<button onclick="window.open('https://www.narendradwivedi.org','_blank');">Website (External Link)</button>
<button onclick="window.open('index.html','_self');">Home Page</button>
</div>
<p>Contact Me via Mail : <a href='mailto:contact@narendradwivedi.org'
style='color:yellow'>contact@narendradwivedi.org</a></p>
<a href='contact.html'><img src='contact_img.png' alt='Contact Image'></a>
</center>
</div>
<div class='all'>
<form>
<p class='p'>Contact Us Form</p><input type='text' id='txtname' placeholder="Enter Name"><br><br>
<textarea id='txtmsg' rows='10' cols='25' placeholder='Enter Your Message'></textarea><br>
<button class='mybtn' onClick='doIT()'>Send</button>
<input type='reset' class='mybtn' value='Reset'>
</form>
</div>
<script>
function doIT()
{
var abc=document.getElementById('txtname').value;
var xyz=document.getElementById('txtmsg').value;
if (abc=="" || xyz=="")
{
alert("Complete All The Fields")
}
else
{
alert(abc+" ,Your Form Submitted Successfully"+"\nYour Message : "+xyz)
}
}
</script>
</body>
</html>
Code For style.css
body {
background: #000000;
font-size: 22px;
line-height: 32px;
color: #ffffff;
word-wrap: break-word !important;
font-family: "Open Sans", sans-serif;
}
h1 {
font-size: 60px;
text-align: center;
color: #fff;
}
h3 {
font-size: 30px;
text-align: center;
color: #fff;
}
h3 a {
color: #fff;
}
a {
color: #fff;
}
h1 {
margin-top: 100px;
text-align: center;
font-size: 60px;
font-family: "Bree Serif", "serif";
}
#container {
margin: 0 auto;
}
p {
text-align: center;
}
nav {
text-align: center;
background-color: #1e85a5;
}rgb(184, 181, 25)rgb(25, 184, 25)
nav ul {
padding: 0;
margin: 0;
list-style: none;
position: relative;
}
nav ul li {
display: inline-block;
background-color: #1e85a5;
}
nav a {
display: block;
padding: 0 10px;
color: #fff;
font-size: 20px;
line-height: 60px;
text-decoration: none;
}
nav a:hover {
background-color: #000000;
}
nav ul ul {
display: none;
position: absolute;
top: 60px;
}
nav ul li:hover > ul {
display: inherit;
}
nav ul ul li {
width: 170px;
float: none;
display: list-item;
position: relative;
}
nav ul ul ul li {
position: relative;
top: -60px;
left: 170px;
}
li > a:after {
content: " +";
}
li > a:only-child:after {
content: "";
}
button {
margin: auto;
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
background-color: #1e85a5;
max-width: 45%;
}
.abc{
display: inline-block;
}
a{
text-decoration: none;
}
.p{
text-align: left;
}
.all
{
margin-left:35px;
}
.mybtn {
margin: auto;
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 10px;
margin: 2px 1px;
cursor: pointer;
background-color: red;
max-width: 45%;
margin-top:15px;
}
input[type=text],textarea {
padding: 12px 20px;
margin: 8px 0;
box-sizing: border-box;
border: 2px solid red;
border-radius: 4px;
background-color: black;
color:white;
}
Download Zip File Of Codes Mirror
Try Our Online HTML Editor
Post a Comment