WAD Module 1
WAD Module 1
PART-A
1)Write a program for Shifting Images Between Transparent and Opaqu?
A) <!DOCTYPE html>
<html>
<head>
<style>
img {
opacity: 0.5;
img:hover {
opacity: 1.0;
</style>
</head>
<body>
<h1>Image Transparency</h1>
<p>The opacity property is often used together with the :hover selector to change the opacity on
mouse-over:</p>
</body>
</html>
2) Design a web application with paragraph tag and use some text formatting tags.
A) <!DOCTYPE html>
<html>
<body>
</html>
3) Design the webpage while defining different elements under the fieldset.
A) <form action="/action_page.php">
<fieldset>
<legend>Personalia:</legend>
<label for="fname">First name:</label>
<input type="text" id="fname" name="fname"><br><br>
<label for="lname">Last name:</label>
<input type="text" id="lname" name="lname"><br><br>
<label for="email">Email:</label>
<input type="email" id="email" name="email"><br><br>
<label for="birthday">Birthday:</label>
<input type="date" id="birthday" name="birthday"><br><br>
<input type="submit" value="Submit">
</fieldset>
</form>
4) Design the static web pages required for an online book store web site
A)
A)part-c q.no-9
6) Create a webpage with HTML describing your department
A) <!DOCTYPE HTML>
<html>
<head>
</head>
<body>
<hr color="blue">
<p>
</p>
<br>
</strong></p>
<br>
full spectrum of the data science life cycle and programming skills.<br>
</p>
<p>
<ol type="1">
<li> Employment</li>.
</ol>
</p>
<p>
</p>
<thead bgcolor="skyblue">
</thead>
<tbody><td>
<ul>
</tbody>
</table>
</body>
</html>
7) Write a program and Apply various colors to suitably distinguish key words, also apply font styling
like italics, underline and two other fonts to words you find appropriate, also use header tags
A) <!DOCTYPE html>
<html>
<body>
</html>
A) <!DOCTYPE html>
<html>
<head>
<style>
html {
scroll-behavior: smooth;
}
#section1 {
height: 600px;
background-color: pink;
.bg-image {
/* Full height */
height: 50%;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
</style>
</head>
<body>
<h1>Smooth Scroll</h1>
<h2>Section 1</h2>
</div>
</html>
<html>
<body>
<h1>TIME TABLE</h1>
<!--<caption>Timetable</caption>-->
<tr>
width="100"><br>
<b>Day/Period</b></br>
</td>
width="100">
<b>I<br>9:30-10:20</b>
</td>
width="100">
<b>II<br>10:20-11:10</b>
</td>
width="100">
<b>III<br>11:10-12:00</b>
</td>
width="100">
<b>12:00-12:40</b>
</td>
width="100">
<b>IV<br>12:40-1:30</b>
</td>
width="100">
<b>V<br>1:30-2:20</b>
</td>
width="100">
<b>VI<br>2:20-3:10</b>
</td>
width="100">
<b>VII<br>3:10-4:00</b>
</td>
</tr>
<tr>
<b>Monday</b></td>
<h2>L<br>U<br>N<br>C<br>H</h2>
</td>
height="50">LAB</td>
<tr>
<b>Tuesday</b>
</td>
height="50">LAB
</td>
</tr>
<tr>
<b>Wednesday</b>
</td>
height="50">LIBRARY
</td>
</tr>
<tr>
<b>Thursday</b>
</td>
height="50">LAB
</td>
</tr>
<tr>
<b>Friday</b>
</td>
height="50">LAB
</td>
</tr>
<tr>
<b>Saturday</b>
</td>
height="50">SEMINAR
</td>
</tr>
</table>
</body>
</html>
10) Design the static web pages required for an online shopping cart.
A)part-a q.no-4
PART-B
1)Name some new features which were not present in HTML but are
added to HTML5?
A) Intro to audio and video:- Audio and Video tags are two major
addition to html5.It allows developers toembed audio andvideo on
their websites.html5 video can use css and css3 to style the video tag
Ex:- <video width = "300" height = "200" controls autoplay>
</header>
<footer>
<nav>
<p>
<a href=
"https://www.geeksforgeeks.org/about/">About Us</a>
</p>
</nav>
</footer>
4)Figure and figcaption:- HTML5 allows to use a <figure> element to
mark up a photo in a document, and a <figcaption> element to
define a caption for the photo. The <figcaption> tag defines a caption
for a <figure> element.
Ex:- <figure>
<img
src="https://media.geeksforgeeks.org/wp-content/cdn-
uploads/20190710102234/
download3.png" alt="GFG" style="width:50%">
<figcaption>Fig.1 - Geeksforgeeks.</figcaption>
</figure>
5) Nav tag:-The <nav> tag defines a set of navigation links. It is used
for the part of an internet site that links to different pages at the
website. The hyperlinks can be organized through a number of
approaches.
Ex:- <nav>
<a href="/html/">HTML</a>
<a href="/css/">CSS</a>
<a href="/js/">JavaScript</a>
<a href="/jquery/">jQuery</a>
</nav>
2) What is Anchor tag and how can you open an URL into a new tab
when clicked?
A) The HTML anchor tag defines a hyperlink that links one page
to another page. It can create hyperlink to other web page as
well as files, location, or any URL. The "href" attribute is the
most important attribute of the HTML a tag. and which links to
destination page or URL.
Syntax:- <a href = "..........."> Link Text </a>
To open link:- we use target as _blank to open link in new tab
<a href="https://www.w3schools.com/" target="_blank">Visit
W3Schools!</a>
3) Write an HTML code to form a table to show the below values in a
tabular form with heading as Roll No., Student name, Subject Name,
and values as Ram, Physics Shyam, Math Murli, Chemistry?
A) <!DOCTYPE html>
<html>
<head>
<title>CODE</title>
<style type="text/css">
table{
border : 1px solid black;
}
td{
border : 1px solid black;
}
th{
border : 1px solid black;
}
</style>
</head>
<body>
<table>
<thead>
<th>Roll No.</th>
<th>Student Name</th>
<th>Subject Name</th>
</thead>
<tr>
<td>1</td>
<td>Ram</td>
<td>Physics</td>
</tr>
<tr>
<td>2</td>
<td>Shyam</td>
<td>Math</td>
</tr>
<tr>
<td>3</td>
<td>Murli</td>
<td>Chemistry</td>
</tr>
</table>
</body>
</html>
4) Explain the structure of the HTML webpage.
The list items will be marked with bullets (small black circles) by default:
Example
<ul>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
Example
<ol>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
The <dl> tag defines the description list, the <dt> tag defines the term
(name), and the <dd> tag describes each term:
Example
<dl>
<dt>Coffee</dt>
<dd>- black hot drink</dd>
<dt>Milk</dt>
<dd>- white cold drink</dd>
</dl>
6) Define iframe in HTML.
An inline frame is used to embed another document within the current HTML
document.
Tip: It is a good practice to always include a title attribute for the <iframe>.
This is used by screen readers to read out what the content of the <iframe> is.
A) HTML Form
An HTML form is a section of a document which contains controls such as text fields,
password fields, checkboxes, radio buttons, submit button, menus etc.
An HTML form facilitates the user to enter data that is to be sent to the server for
processing such as name, email address, password, phone number, etc. .
HTML forms are required if you want to collect some data from of the site visitor.
For example: If a user want to purchase some items on internet, he/she must fill the
form such as shipping address and credit/debit card details so that item can be sent
to the given address.
1. <form>
2. <label for="password">Password: </label>
3. <input type="password" id="password" name="password"/> <br/>
4. </form>
8) In how many ways can a heading be written in HTML?
A) HTML defines six levels of headings, and these heading elements are H1, H2, H3, H4, H5, and H6.
The H1 element is the highest or most important level, and the H6 element is the least important.
These different heading levels help to communicate the organization and hierarchy of the content
on a page. For example, headings with an equal or higher ranking indicate the start of a new
section, and headings with a lower rank indicate the start of a new subsection that is part of a
higher-ranked section.
9) What are the various formatting tags in HTML?.
HTML contains different elements that define the structure of a web page:
• <article>: This is the primary element that contains information about the
web page
A) Although checkboxes don’t affect one another, grouping checkboxes together help
to organize them. Checkbox buttons can have their name and do not need to belong
to a group. A single web page can have many different groups of checkboxes.
15)repeated q no-5
A)
Logical tags are used to provide information by Physical tags are used to style the
6.
giving the special importance to the text. For content only. For instance, <i> is
S.No. Logical tags Physical tags
instance, <em> tag is used to emphasize the text used to display the text in italic
by representing it in italic format. format.
S.No.
Logical tags
Physical tags
1.
Logical tags describe the behaviour, nature of content for the text enclosed inside the
tag. They represent the function of text on the page.
Physical tags are used to decide the appearance of the text and do not provide any
information about the text.
2.
It is extremely straightforward.
3.
4.
5.
It supports the latest technology.
6.
Logical tags are used to provide information by giving the special importance to the
text. For instance, <em> tag is used to emphasize the text by representing it in italic
format.
Physical tags are used to style the content only. For instance, <i> is used to display the
text in italic format.
This code will show the message “It works!” in your browser’s
developer output window, which we will look at soon.
In your index.html file, add a script tag to load your new JavaScript.
The script tag should be the last line of code before your
closing body tag.
This is the line you need to add:
<script src="my-project.js"></script>
Make sure you have saved all your files, especially your new my-
project.js and your changes to index.html.
In Chrome, click on the options menu at the top right, which looks
like three little dots. Go to More Tools then click Developer
Tools.
In the developer tools, click on the tab called Console and you
should see your message “It works!”
If you do not see the message, you will need to double-check that
you have followed the steps correctly.
18)What is the use of a span tag? Give one example.
A)refer Q.no-11
19) What are the features of HTML?
A) 1) It is a very easy and simple language. It can be easily understood and modified.
2) It is very easy to make an effective presentation with HTML because it has a lot of
formatting tags.
4) It facilitates programmers to add a link on the web pages (by html anchor tag), so
it enhances the interest of browsing of the user.
6) It facilitates the programmer to add Graphics, Videos, and Sound to the web pages
which makes it more attractive and interactive.
7) HTML is a case-insensitive language, which means we can use tags either in lower-
case or upper-case.
Whatever written
within a HTML tag
HTML tag starts with < are HTML HTML attributes are found
and ends with > elements. only in the starting tag.
A) HTML Tags: Tags are the starting and ending parts of an HTML element. They begin with < symbol
and end with > symbol. Whatever written inside < and > are called tags.
Example:
• html
<b> </b>
HTML elements: Elements enclose the contents in between the tags. They consist of some kind of
structure or expression. It generally consists of a start tag, content and an end tag.
Example:
• html
Where, <b> is the starting tag and </b> is the ending tag.
HTML Attributes: It is used to define the character of an HTML element. It always placed in the
opening tag of an element. It generally provides additional styling (attribute) to the element.
Example:
• html
This is paragraph.
There is a special group of elements that only have start tags and does not contain any content
within it, these elements are called void elements. Void elements doesn’t have ending tags and can
only have attributes but do not contain any kind of content. These elements can have backslash
before ending of start tag but that is completely optional. Example of such elements
are <br>, <hr>, <img>, <input>, <link>, <base>, <meta>, <param>, <area>, <embed>, <col>, <track>,
<source> etc.
Characteristics:
A) Some characters are reserved in HTML and they have special meaning when used
in HTML document. For example, you cannot use the greater than and less than signs
or angle brackets within your HTML text because the browser will treat them
differently and will try to draw a meaning related to HTML tag.
HTML processors must support following five special characters listed in the table
that follows.
• <title>
• <style>
• <base>
• <link>
• <meta>
• <script>
• <noscript>
5) How is Cell Padding different from Cell Spacing?
• A) Cellpadding:
Cellpadding specifies the space between the border of a table cell and
its contents (i.e) it defines the whitespace between the cell edge and
the content of the cell.
Syntax:
<table cellpadding="value" >.....</table>
where, value determines the padding
(space between the border of a table and its content)
• Cellspacing:
Cellspacing specifies the space between cells (i.e) it defines the
whitespace between the edges of the adjacent cells.
Syntax:
<table cellspacing="value" >.....</table>
where, value determines the padding
(space between adjacent cells)
6) How can we club two or more rows or columns into a single row or column in an HTML table?
A) To merge cells in HTML, use the colspan and rowspan attribute. The rowspan
attribute is for the number of rows a cell should span, whereas the colspan attribute is
for a number of columns a cell should span.
Both the attribute will be inside the <td> tag. The number will be a numeric value, for
example, 2 for 2 rows if rowspan, 2 for 2 columns if column span.
Example
Firstly, we will see how to create a table in HTML with 3 rows and 3 columns
<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
border: 1px solid black;
width: 100px;
height: 50px;
}
</style>
</head>
<body>
<h1>Heading</h1>
<table>
<tr>
<th></th>
<th></th>
<th></th>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</body>
</html>
HTML Events
An HTML event can be something the browser does, or something a user
does.
Example
<button onclick="document.getElementById('demo').innerHTML =
Date()">The time is?</button>
9) How can we include audio or video in a webpage?
Audio and Video tags are the two major addition to HTML5. It allows developers to embed a video
or audio on their website. HTML5 video can use CSS and CSS3 to style the video tag. You can change
the border, opacity, reflections, gradients, transitions, transformations, and even animations. HTML5
makes adding video super-fast and without having to build a video player. This saves time for the
developer and offers the client a superior and more affordable solution.
Example:
o HTML
<!DOCTYPE html>
<html>
<body>
</audio>
</body>
</html>
video output
A) Drag and drop is a very common feature. It is when you "grab" an object
and drag it to a different location.
<!DOCTYPE HTML>
<html>
<head>
<script>
function allowDrop(ev) {
ev.preventDefault();
}
function drag(ev) {
ev.dataTransfer.setData("text", ev.target.id);
}
function drop(ev) {
ev.preventDefault();
var data = ev.dataTransfer.getData("text");
ev.target.appendChild(document.getElementById(data));
}
</script>
</head>
<body>
</body>
</html>
11)What type of audio files can be played using HTML5?
A) Currently, there are 3 supported “audio formats” for the HTML5 “audio” tag: .mp3, .ogg, and
.wav.
Internet Explorer supports: .mp3 (Yes), .ogg (No), .wav (No)
Chrome supports: .mp3 (Yes), .ogg (Yes), .wav (Yes)
Firefox supports: .mp3 (some browsers Yes, some No), .ogg (Yes), .wav (Yes)
Safari supports: .mp3 (Yes), .ogg (No), .wav (Yes)
Opera supports: .mp3 (No), .ogg (Yes), .wav (Yes)
CSS handles the look and feel part of a web page. Using CSS, you can control the
color of the text, the style of fonts, the spacing between paragraphs, how columns
are sized and laid out, what background images or colors are used, layout
designs,variations in display for different devices and screen sizes as well as a variety
of other effects.
CSS is easy to learn and understand but it provides powerful control over the
presentation of an HTML document. Most commonly, CSS is combined with the
markup languages HTML or XHTML.
Advantages of CSS
• CSS saves time − You can write CSS once and then reuse same sheet in
multiple HTML pages. You can define a style for each HTML element and
apply it to as many Web pages as you want.
• Pages load faster − If you are using CSS, you do not need to write HTML tag
attributes every time. Just write one CSS rule of a tag and apply it to all the
occurrences of that tag. So less code means faster download times.
• Easy maintenance − To make a global change, simply change the style, and
all elements in all the web pages will be updated automatically.
• Superior styles to HTML − CSS has a much wider array of attributes than
HTML, so you can give a far better look to your HTML page in comparison to
HTML attributes.
• Multiple Device Compatibility − Style sheets allow content to be optimized
for more than one type of device. By using the same HTML document, different
versions of a website can be presented for handheld devices such as PDAs
and cell phones or for printing.
• Global web standards − Now HTML attributes are being deprecated and it is
being recommended to use CSS. So its a good idea to start using CSS in all
the HTML pages to make them compatible to future browsers.
13) Discuss about Color attributes
A) Colors are very important to give a good look and feel to your website. You can
specify colors on page level using <body> tag or you can set colors for individual tags
using bgcolor attribute.
The <body> tag has following attributes which can be used to set different colors −
• Color names − You can specify color names directly like green, blue or red.
• Hex codes − A six-digit code representing the amount of red, green, and blue
that makes up the color.
• Color decimal or percentage values − This value is specified using the rgb(
) property.
A)part-b q.no-15
A) It is a type of computer program that usually runs with the help of a web browser
and also uses many web technologies to perform various tasks on the internet.
A web application can be developed for several uses, which can be used by anyone
like it can be used as an individual or as a whole organization for several reasons.
In general, a web application can contain online shops (or we can also say them e-commerce
shops), webmail's, calculators, social media platforms, etc. There is also some kind of web
application that usually requires a special kind of web browser to access them. We cannot
access those kinds of web applications by using regular web- browsers. However, most of the
web applications available on the internet can be accessed using a standard web browser.
If we talk about the web application in general, a web application usually uses a
combination of the server-side scripts such as PHP, ASP, for handling the information/
data storage and retrieval of the data.
Some of them also use the client-side scripts such as JavaScript, HTML to represent
the data/information in front of the users, and some of the web applications are also
using both server-side and client-side at the same time.
The term server can refer to a physical machine, a virtual machine or to software
that is performing server services. The way that a server works varies considerably
depending on how the word server is being used.
The operating system also provides the means for clients to communicate with the
server application. The server's IP address and fully qualified domain name, for
example, are assigned at the operating system level.
Example
<a href="https://www.w3schools.com">Visit W3Schools</a>
Try it Yourself »
You will learn more about links in our HTML Links chapter.
Example
<img src="img_girl.jpg">
Try it Yourself »
Example
<img src="img_girl.jpg" width="500" height="600">
Try it Yourself »
Example
<img src="img_girl.jpg" alt="Girl with a jacket">
Try it Yourself »
Example
See what happens if we try to display an image that does not exist:
Example
<p style="color:red;">This is a red paragraph.</p>
Try it Yourself »
You will learn more about styles in our HTML Styles chapter.
The lang Attribute
You should always include the lang attribute inside the <html> tag, to declare
the language of the Web page. This is meant to assist search engines and
browsers.
<!DOCTYPE html>
<html lang="en">
<body>
...
</body>
</html>
18)repeated-17
A) The legend tag is used to define the title for the child contents. The legend elements are
the parent element. This tag is used to define the caption for the <fieldset> element.
Syntax
Attribute :
The <fieldset> tag in HTML5 is used to make a group of related elements in the
form, and it creates the box over the elements. The <fieldset> tag is new in
HTML5. The <legend> tag is used to define the title for the child’s contents. The
legend elements are the parent element. This tag is used to define the caption for
the <fieldset> element.
Syntax:
<fieldset>Contents</fieldset>
Attribute:
disabled: It is used to specify that the group of related form elements is disabled. A
disabled fieldset is un-clickable and unusable.
form: It is used to specify the one or more forms that the <fieldset> element
belongs to.
Example: This simple example illustrates the use of the <fieldset> tag in order to
make a group of related elements in the HTML Form.
<fieldset>
<legend>STUDENT::</legend>
<label>Name:</label>
<input type="text">
<br><br>
<label>Email:</label>
<input type="text">
<br><br>
<label>Date of birth:</label>
<input type="text">
<br><br>
<label>Address:</label>
<input type="text">
<br><br>
<label>Enroll No:</label>
<input type="text">
</fieldset>
A)part-b q.no-10