Professional Documents
Culture Documents
WD Material
WD Material
WD Material
Unit-I
1. What is Paragraph element in HTML
In HTML <p> element defines a paragraph.
A paragraph always starts on a new line, and browsers automatically add some white space (a margin) before and
after a paragraph.
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
2. Write a short note on Headings in HTML
HTML headings are titles or subtitles that you want to display on a webpage.
Different Sizes:
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>
bgcolor is used for background color, which takes background color name or hexadecimal number and
#FFFFFF and background attribute will take the path of the image which you can place as the background
image in the browser.
Example: <body bgcolor=”cyan” background= “c:\amer\imag1.gif”>
1
WD_Study Material WD_Study Material WD_Study Material
7. What is <i> in HTML
Italic tag: This implements italic effects on the text.
Example: <i>.......</i>
2
WD_Study Material WD_Study Material WD_Study Material
Example:
Example:
HTML tags are used to hold the HTML element. HTML element holds the content.
The complete address of a document on the internet is The relative URL is a document’s online partial
known as an absolute URL. address.
All the information needed to locate files online is Only file names or file names with folder names are
contained in the absolute URL. contained in relative URLs.
3
WD_Study Material WD_Study Material WD_Study Material
15. Construct ordered list.
<html>
<body>
<h2>An ordered HTML list</h2>
<ol>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
</body>
</html>
18. How each of these forms shall sent/retrieve data across web:
a form for accessing your bank account online _get__
5
WD_Study Material WD_Study Material WD_Study Material
24. List Tag and its classification
Unordered List
An unordered list starts with the <ul> tag. Each list item starts with the <li> tag.
HTML Unordered List or Bulleted List displays elements in bulleted format. We can use unordered list
where we do not need to display items in any particular order. The HTML ul tag is used for the unordered
list. There can be 4 types of bulleted list:
o disc
o circle
o square
o none
The list items will be marked with bullets (small black circles) by default:
<ul>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
Circle/Square
<ul type="circle"/”square”>
<li>HTML</li>
<li>Java</li>
<li>JavaScript</li>
<li>SQL</li>
</ul>
6
WD_Study Material WD_Study Material WD_Study Material
<table border=”1”>
<caption>Demo Table</caption>
<tr>
<th>Name</th>
<td>Jill</td>
</tr>
<tr>
<th rowspan="2">Phone</th>
<td>555-1234</td>
</tr>
<tr>
<td>555-8745</td>
</tr>
</table>
26. What do you mean by column spanning?
<html>
<table border=”1”>
<tr>
<th colspan="2">Name</th>
<th>Age</th>
</tr>
<tr>
<td>Surisetty</td>
<td>Tarun</td>
<td>43</td>
</tr>
</table>
</html>
The HTML <map> tag defines an image map. An image map is an image with clickable areas.
The areas are defined with one or more <area> tags.
The image is inserted using the <img> tag.
<img src="Taj.jpg" alt="Tajmahal" usemap="#taj">
Shape:
You must define the shape of the clickable area, and you can choose one of these values:
rect - defines a rectangular region
circle - defines a circular region
poly - defines a polygonal region
default - defines the entire region
7
WD_Study Material WD_Study Material WD_Study Material
Syntax:
<img src="worldmap.jpg" alt="World_map" usemap="#worldmap">
<map name="worldmap">
<area shape="rect" coords="34,44,270,350" alt="AP" href="andhra.htm">
<area shape="rect" coords="290,172,333,250" alt="TS" href="telangana.htm">
<area shape="circle" coords="337,300,44" alt="Kerala" href="Kerala.htm">
</map>
28. Display a web page to register student details using input elements
<html>
<head>
<title>
Registration Page
</title>
</head>
<body bgcolor="Lightskyblue"> <br> <br>
<form>
Square
<ul type="circle">
<li>HTML</li>
<li>Java</li>
<li>JavaScript</li>
<li>SQL</li>
</ul>
None
<ul type="none">
<li>HTML</li>
<li>Java</li>
<li>JavaScript</li>
<li>SQL</li>
</ul>
The HTML <form> element can contain one or more of the following form elements:
<input>
The <input> element can be displayed in several ways, depending on the type attribute.
<label>
The <label> element is useful for screen-reader users, because the screen-reader will read out loud the
label when the user focus on the input element.
<select>
9
WD_Study Material WD_Study Material WD_Study Material
<textarea>
<button>
<fieldset>
<form action="/action_page.php">
<fieldset>
<legend>Personalia:</legend>
<datalist>
The <datalist> element specifies a list of pre-defined options for an <input> element.
The <form> tag is used to create an HTML form for user input.
The <form> element can contain one or more of the following form elements:
<input>
<textarea>
<button>
<select>
<option>
<optgroup>
<fieldset>
<label>
<output>
10
WD_Study Material WD_Study Material WD_Study Material
<html>
<body>
<form >
<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>
<input type="submit" value="Submit">
</form>
<p>Click the "Submit" button and the form-data will be sent to a page on the
server called "action_page.php".</p>
</body>
</html>
34. What is meta tag? What are its attribute and usage?
The <meta> tag defines metadata about an HTML document. Metadata is data (information) about data.
<meta> tags always go inside the <head> element, and are typically used to specify character set, page
description, keywords, author of the document, and viewport settings.
Metadata will not be displayed on the page, but is machine parsable.
Metadata is used by browsers (how to display content or reload page), search engines (keywords), and other
web services.
Example:
Define a description of your web page:
<meta name="description" content="Free Web tutorials for HTML and CSS">
<head>
<meta charset="UTF-8">
<meta name="description" content="Free Web tutorials">
<meta name="keywords" content="HTML, CSS, JavaScript">
<meta name="author" content="John Doe">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
35. Create a simple timetable for two days using Table Tag.
<html>
<body>
<h1>TIME TABLE</h1>
<table border=”1”>
<tr> <th > Hour</th>
<th >I(9-10)</th>
<th >II(10-11)</th>
<th >III(11-12)</th>
<th>IV(1-2)</th>
<th >V(2-3) </th>
11
WD_Study Material WD_Study Material WD_Study Material
</tr>
<tr> <td >Monday</td>
<td >Mat</td>
<td >phy</td>
<td >Eng</td>
<td >Che</td>
<td >LIBRARY </td>
</tr>
font tag: This sets font size, color and relative values for a particular text.
Example: <font size=”10” color=”red”>
Example: <p><font size="30" color=”red”>Hello This is Vignan’s</font></p>
bold tag: This tag is used for implement bold effect on the text
Example: <b> ....... </b>
12
WD_Study Material WD_Study Material WD_Study Material
Italic tag: This implements italic effects on the text.
Example: <i>.......</i>
Underline: This The <u> tag represents some text that is unarticulated and styled differently from normal text.
Example: <p>This is some <u> mispled </u> text.</p>
sub and sup tag: These tags are used for subscript and superscript effects on the text.
Example: <sub> ..........</sub>
<sup>...........</sup>
13
WD_Study Material WD_Study Material WD_Study Material
Unit-II
1. Explain <article> element in HTML5.
An article should make sense on its own and it should be possible to distribute it independently from the rest of the
site.
<article>
<h2>Google Chrome</h2>
<p>Google Chrome is a web browser developed by Google, released in 2008. Chrome is the world's most
popular web browser today!</p>
</article>
<article>
<h2>Mozilla Firefox</h2>
<p>Mozilla Firefox is an open-source web browser developed by Mozilla. Firefox has been the second most
popular web browser since January, 2018.</p>
</article>
authorship information
copyright information
contact information
sitemap
back to top links
related document
<footer>
<p>Author: Galvin</p>
<p><a href="mailto:galvin@example.com">galvin@example.com</a></p>
</footer>
The <header> element represents a container for introductory content or a set of navigational links.
<header>
<h1>Main page heading here</h1>
<p>Posted by John Doe</p>
</header>
14
WD_Study Material WD_Study Material WD_Study Material
4. Discuss <nav> tag in HTML5.
The <nav> tag defines a set of navigation links.
All links of a document should not be inside a <nav> element.
The <nav> element is intended only for major blocks of navigation links.
<nav>
<a href="/html/">HTML</a>
<a href="/python/">Python</a>
</nav>
<figure>
<img src="Tajmahal.jpg" alt="Hindustan" style="width:100%">
<figcaption>Fig.1 - Tajmahal, Aagra, India.</figcaption>
</figure>
15
WD_Study Material WD_Study Material WD_Study Material
1. Simple Selector
2. Id Selector
3. Class Selector
4. Universal Selector
5. Group Selector and
16
WD_Study Material WD_Study Material WD_Study Material
<h1>Hello world!</h1>
<p>Every element on the page will be affected by the style.</p>
<p>Me too!</p>
<p>And me!</p>
</body>
</html>
17
WD_Study Material WD_Study Material WD_Study Material
h1 {
color: white;
text-align: center;
}
p{
font-family: verdana;
font-size: 20px;
}
</style>
</head>
<body>
</body>
</html>
18
WD_Study Material WD_Study Material WD_Study Material
<canvas> element
The HTML <svg> element (SVG stands for Scalable Vector Graphics)
<body>
<h1> Vignan </h1>
19
WD_Study Material WD_Study Material WD_Study Material
</body>
</html>
Output:
<aside>
<html>
<body>
<h1>The aside element</h1>
<p>My family and I visited The Epcot center this summer. The weather was nice, and Epcot was amazing! I
had a great summer together with my family!</p>
<aside>
<h4>Epcot Center</h4>
<p>Epcot is a theme park at Walt Disney World Resort featuring exciting attractions, international pavilions,
award-winning fireworks and seasonal special events.</p>
</aside>
</body>
</html>
<figcaption>
<html>
<body>
<h1>The figure and figcaption element</h1>
<figure>
<img src="pic_trulli.jpg" alt="Trulli" style="width:100%">
<figcaption>Fig.1 - Trulli, Puglia, Italy.</figcaption>
20
WD_Study Material WD_Study Material WD_Study Material
</figure>
</body>
</html>.
<figure>
The <figure> tag specifies self-contained content, like illustrations, diagrams, photos, code listings, etc.
<html>
<body>
<h1>The figure and figcaption element</h1>
<figure>
<img src="taj.jpg" alt="Tajmahal" style="width:100%">
<figcaption>Fig.1 - Taj, Aagra, India.</figcaption>
</figure>
</body>
</html>.
<html>
<body>
<h1>The canvas element</h1>
<canvas id="myCanvas">Your browser does not support the canvas tag.</canvas>
<script>
var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
ctx.fillStyle = "#FF0000";
ctx.fillRect(0, 0, 80, 100);
</script>
</body>
21
WD_Study Material WD_Study Material WD_Study Material
</html>
th {
height: 70px;
}
22
WD_Study Material WD_Study Material WD_Study Material
v) Responsive Table
A responsive table will display a horizontal scroll bar if the screen is too small to display the full content:
<div style="overflow-x:auto;">
<table>
... table content ...
</table>
</div>
23
WD_Study Material WD_Study Material WD_Study Material
<textarea name="message" rows="10" cols="30">
The cat was playing in the garden.
</textarea>
CSS font color is a standalone attribute in CSS although it seems that it is a part of CSS fonts. It is used to
change the color of the text.
By a color name
By hexadecimal value
By RGB
<!DOCTYPE html>
<html>
<head>
<style>
body {
font-size: 100%;
}
h1 { color: red; }
h2 { color: #9000A1; }
p { color:rgb(0, 220, 98); }
}
</style>
</head>
<body>
<h1>This is heading 1</h1>
<h2>This is heading 2</h2>
<p>This is a paragraph.</p>
</body>
</html>
24
WD_Study Material WD_Study Material WD_Study Material
Font family: It specifies the font family name like Arial, New Times Roman etc.
Serif: Serif fonts include small lines at the end of characters. Example of serif: Times new roman,
Georgia etc.
Sans-serif: A sans-serif font doesn't include the small lines at the end of characters. Example of Sans-serif:
Arial, Verdana etc.
<!DOCTYPE html>
<html>
<head>
<style>
body {
font-size: 100%;
}
h1 { font-family: sans-serif; }
h2 { font-family: serif; }
p { font-family: monospace; }
}
</style>
</head>
<body>
<h1>This heading is shown in sans-serif.</h1>
<h2>This heading is shown in serif.</h2>
<p>This paragraph is written in monospace.</p>
</body>
</html>
CSS font size property is used to change the size of the font.
<html>
<head>
<title>Practice CSS font-size property</title>
</head>
<body>
<p style="font-size:xx-large;"> This font size is extremely large. </p>
<p style="font-size:smaller;"> This font size is smaller. </p>
<p style="font-size:larger;"> This font size is larger. </p>
<p style="font-size:200%;"> This font size is set on 200%. </p>
<p style="font-size:20px;"> This font size is 20 pixels. </p>
25
WD_Study Material WD_Study Material WD_Study Material
</body>
</html>
Text Color: This property is used to set the color of the text and the color can be set by using a color
name like “red”, hex value “#ff0000”, or by its RGB value “rgb(255,0,0)”;
Text-align: This property in CSS is used to specify the horizontal alignment of text in an element inside
a block element or table-cell box.
Text-align-last: It is used to set the last line of the paragraph just before the line break. It sets the
alignment of all the last lines occurring in the element in which the text-align-last property is applied.
Text-decoration: text-decoration property is used to “decorate ” the content of the text.
Text-decoration-color: It is used to set the color of the decorations (overlines, underlines, and line-
throughs) over the text.
Text-decoration-line: It is used to set the various kinds of text decorations. this may include many
values such as underline, overline, line-through, etc.
32. ID Selector
The id selector uses the id attribute of an HTML element to select a specific element.
The id of an element is unique within a page, so the id selector is used to select one unique element!
To select an element with a specific id, write a hash (#) character, followed by the id of the element.
<html>
<head>
<style>
#para1 {
26
WD_Study Material WD_Study Material WD_Study Material
text-align: center;
color: red;
}
</style>
</head>
<body>
</body>
</html>
HTML HTML-5
It didn’t support audio and video without the It supports audio and video controls with the
use of flash player support. use of <audio> and <video> tags.
Does not allow JavaScript to run in browser. Allows JavaScript to run in background. This
is possible due to JS Web worker API in
HTML5.
It works with all old browsers. It supported by all new browser like Firefox,
Mozilla, Chrome, Safari, etc.
Older version of HTML are less mobile- HTML5 language is more mobile-friendly.
friendly.
Elements like nav, header were not present. New element for web structure like nav,
header, footer etc.
Being an older version , it is not fast , flexible , and It is efficient, flexible and more fast in comparison to
efficient as compared to HTML5. HTML.
27
WD_Study Material WD_Study Material WD_Study Material
<h1 style="color:blue;">A Blue Heading</h1>
<p style="color:red;">A red paragraph.</p>
</body>
</html>
Internal CSS
An internal CSS is used to define a style for a single HTML page.
An internal CSS is defined in the <head> section of an HTML page, within a <style> element.
The following example sets the text color of ALL the <h1> elements (on that page) to blue, and the text
color of ALL the <p> elements to red. In addition, the page will be displayed with a "powderblue"
background color:
<!DOCTYPE html>
<html>
<head>
<style>
body {background-color: powderblue;}
h1 {color: blue;}
p {color: red;}
</style>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
External CSS
An external style sheet is used to define the style for many HTML pages.
To use an external style sheet, add a link to it in the <head> section of each HTML page:
External Program Segment to be linked (named demo.css):
body{ background-color : cyan}
h1{color:white;
text-align:center}
Actual Program:
<html>
<head>
<link rel="stylesheet" href="demo.css">
</head>
<body>
<h1> Vignan </h1>
</body>
</html>
28
WD_Study Material WD_Study Material WD_Study Material
<html>
<head>
<style>
div.a {
text-align: center;
font-size: 200%;
}
div.b {
text-align: left;
font-size: 200%;
}
div.c {
text-align: right;
font-size: 200%;
}
</style
</head>
<body>
<body bgcolor="aquablue">
<div class="a">
<p font size=20>Assam</p>
</div>
<div class="b">
<p>Bengal</p>
</div>
<div class="c">
<p>Odisha</p>
</div>
<footer>
<p>Author: AI_DS<br>
<a href="https://vignaniit.edu.in/">Click here to open VIIT Website</a></p>
</footer>
</body>
</html>
Unit-III
1. What is XML?
XML stands for eXtensible Markup Language
XML is a markup language much like HTML
XML was designed to store and transport data
XML is a W3C Recommendation
XML simplifies data sharing
XML simplifies data transport
XML simplifies platform changes
XML simplifies data availability
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
30
WD_Study Material WD_Study Material WD_Study Material
4. Namespaces:
In XML, element names are defined by the developer. This often results in a conflict when trying to mix XML
documents from different XML applications.
<table>
<tr>
<td>Apples</td>
<td>Bananas</td>
</tr>
</table>
<table>
<name>African Coffee Table</name>
<width>80</width>
<length>120</length>
</table>
If the above XML fragments were added together, there would be a name conflict. Both contain a <table>
element, but the elements have different content and meaning.
<h:table>
<h:tr>
<h:td>Apples</h:td>
<h:td>Bananas</h:td>
</h:tr>
</h:table>
<f:table>
<f:name>African Coffee Table</f:name>
<f:width>80</f:width>
<f:length>120</f:length>
</f:table>
32
WD_Study Material WD_Study Material WD_Study Material
5. List the Characteristics of XML
Extensible and Human Readable. Even if additional data is added, most XML applications will continue to
function as intended.
Overall Simplicity. ...
Separates Data from HTML. ...
Allows XML Validation. ...
XML Supports Unicode. ...
Used to Create New Languages.
6. #PCDATA in xml
PCDATA means Parsed Character Data. It is used in DTDs to describe the type of the XML data. It simply
means the specific element contains data that should be parsed by the parser and should not be ignored.
The CDATA on the other hand tells the parser not to worry about the data. ie., telling it not to parse it.
Ration
PAN NAME AREA PIN
AW54325 MURTHY SIRIPURAM 533006
AW22563 MOHAN TUNI 530404
AW57325 RAMESH GOA 531212
<Ration>
<PAN>AW54325</PAN>
<NAME>MURTHY</NAME>
<AREA>SIRIPURAM</AREA>
<PIN>533006</PIN>
<PAN> AW22563</PAN>
<NAME> MOHAN </NAME>
<AREA> TUNI </AREA>
<PIN>530404</PIN>
<PAN> AW57325</PAN>
<NAME> RAMESH </NAME>
<AREA> GOA </AREA>
<PIN>531212</PIN>
</Ration>
Output:
33
WD_Study Material WD_Study Material WD_Study Material
1) DTD stands for Document Type XSD stands for XML Schema Definition.
Definition.
2) DTDs are derived from SGML syntax. XSDs are written in XML.
3) DTD doesn't support datatypes. XSD supports datatypes for elements and
attributes.
5) DTD doesn't define order for child XSD defines order for child elements.
elements.
7) DTD is not simple to learn. XSD is simple to learn because you don't need to
learn new language.
8) DTD provides less control on XML XSD provides more control on XML structure.
structure.
XML HTML
The main purpose is to focus on the transport of Focuses on the appearance of data. Enhances the
data and saving the data appearance of text
XML is dynamic because it is used in the transport HTML is static because its main function is in the
of data display of data
It is case-sensitive. The upper and lower case needs It is not case-sensitive. Upper and lower case are of
to be kept in mind while coding not much importance in HTML
You can define tags as per your requirement, but It has its own pre-defined tags, and it is not
closing tags are mandatory necessary to have closing tags
Any error in the code shall not give the final Small errors in the coding can be ignored and the
outcome outcome can be achieved
35