IWP MQP Solpdf
IWP MQP Solpdf
IWP MQP Solpdf
Example Explained
• The <!DOCTYPE html> declaration defines that this document is an HTML5 document
• The <html> element is the root element of an HTML page
• The <head> element contains meta information about the HTML page
• The <title> element specifies a title for the HTML page (which is shown in the browser's
title bar or in the page's tab)
• The <body> element defines the document's body, and is a container for all the visible
contents, such as headings, paragraphs, images, hyperlinks, tables, lists, etc.
• The <h1> element defines a large heading
* The <p> element defines a paragraph
1c. Explain the following tags with example: i) <p> ii) <img> iii) <br>
* <br> tag is used to insert a single line break, it doesn’t require end tag in HTML.
* The <img> tag is used to embed an image in an HTML page. Images are not technically inserted into a web page; images
<img> tag creates a holding space for the referenced image.
<img src=robot.gif height=10 width=10 alt=robot>
Semantic elements have meaningful names which tells about type of content. For example <header>,
<footer>, <table>, etc. HTML5 introduces many semantic elements as mentioned below which make the
code easier to write and understand for the developer as well as instructs the browser on how to treat them. A
semantic element clearly describes its meaning to both the browser and the developer.
<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>
3b. Explain the following tags i)audio ii)video
<audio src="http://htmlref.com/ch2/music.wav"></audio>
The <audio> tag is used to embed sound content in a document, such as music or other audio
streams. This tag contains one or more <source> tags with different audio sources. The browser will
choose the first source it supports. The text between the <audio> and </audio> tags will only be
displayed in browsers that do not support the <audio> element.
There are three supported audio formats in HTML: MP3, WAV, and OGG.
<!DOCTYPE html>
<html>
<body>
<h2>Personal Details</h2>
<form>
<label for="fname">Name:
<input type="text" id="fname" name="fname" value=" "><br></label><br>
<label for="lname">Password:
<input type="text" id="lname" name="lname" value=" "></label><br><br>
<label for="fname">Email id:
<input type="text" id="fname" name="fname" value=" "><br></label><br>
<label>Gender:
Male<input type="radio" value="male" name="gender" /></label>
<label>Female<input type="radio" value="female" name="gender" /></label> <br> <br>
<label for="fname">Contact#:
<input type="text" id="fname" name="fname" value=" "><br></label><br>
</form>
<h2>Education Qualification</h2>
<label for="fname">Degree:
<select name="language">
<option value="indian"> - Select Group - </option>
</select></label><br><br>
<label for="fname">Engineering:
<select name="language">
<option value="indian"> - Select Group - </option></select>
<br><br>
<label>Hobbies:
Playing Chess<input type="radio" value="Playing Chess" name="gender" /></label>
<label>Reading Books<input type="radio" value="Reading Books" name="gender"
/></label> <br> <br>
<h2>Address</h2>
<form>
<textarea name="welcomeMessage" rows="3" cols="40"></textarea>
</form> <br><br>
<label for="fname">Attach Resume:
<input type="submit" value="Choose File"> <label for="fname">No file chosen:
<br><br>
<input type="submit" value="Submit">
</body>
</html>
4a. Briefly explain client side graphics with <canvas>
Context.lineTo( ) method is used to add a line segment to the end of the path.
Once all subpaths are properly added, context.closePath() can optionally be called to close
the loop.
The createLinearGradient() method creates a linear gradient object. The gradient can be
used to fill rectangles, circles, lines, text, etc.
The createRadialGradient() method creates a radial/circular gradient object.
window. onload :
We can use this function to perform some task as soon as the page finishes loading. This
JavaScript function is used in different condition like displaying a print page or directing
focus to user input field as soon as the page is loaded.
The getElementById() :
This method returns an element with a specified value. It returns null if the element does not
exist.
The <canvas> element has a method called getContext() , used to obtain the rendering
context and its drawing functions. getContext() takes one parameter, the type of context.
Drawing Arcs and Curves
Drawing on canvas is possible by using arc(), arcTo(), quadraticCurveTo(), and
bezierCurveTo().
Scaling, Rotating, and Translating Drawings :
The canvas API provides a number of useful methods that accomplish the common tasks.
First let’s explore the scale(x,y) function, which can be used to scale objects. The x parameter
shows how much to scale in the horizontal direction and the y parameter indicates how much
to scale vertically.
The <iframe> tag specifies an inline frame. An inline frame is used to embed another
document within the current HTML document. HTML5 continues to support
<iframe>; in fact, it not only supports it but extends the tag.
HTML5 proposes two new attributes for the iframe element: seamless and
sandbox. The seamless attribute effectively renders the iframe as an inline include,
which allows the parent document’s CSS to affect the contents of the iframe:
5a. Explain the different levels of Style Sheets are available in Cascading Style Sheets.
The most common way to add CSS, is to keep the styles in external CSS files.
Inline CSS:
An inline CSS is used to apply a unique style to a single HTML element. It uses
the style attribute of an HTML element.
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:
Internal CSS :
An internal CSS is used to define a style for a single HTML page. It is defined in
the <head> section of an HTML page, within a <style> element.
A CSS selector selects the HTML element(s) we want to style. They are used to "find" (or select) the
HTML elements we want to style.
We can divide CSS selectors into five categories:
• Simple selectors (select elements based on name, id, class)
• Combinator selectors (select elements based on a specific relationship between them)
• Pseudo-class selectors (select elements based on a certain state)
• Pseudo-elements selectors (select and style a part of an element)
Attribute selectors (select elements based on an attribute or attribute value)
The div and span elements are generic elements in that they don’t provide any
special meaning when they’re used by themselves. They are simply placeholders to
which CSS is applied. Think of div and span as vanilla ice cream and CSS as the
various toppings you can add to the ice cream, such as chocolate chips, mint
flavoring, and Oreos. Yummm!
6a. With examples, Explain BOX, padding and margin properties in CSS
In Figure given above, the dashed lines indicate the perimeters of the margin and padding areas.
When a web page is displayed, only the border can be made visible; the dashed lines shown in the
figure are only for illustration purposes. .
The padding property specifies the width of the area on the interior of an element’s border, whereas
the margin property specifies the width of the area on the exterior of an element’s border. Here’s an
example CSS rule that uses padding and margin properties:
The margin and padding properties allow negative values. While a positive value forces two
elements to be separated by a specified amount, a negative value causes two elements to overlap
by a specified amount.
Using an absolute URL, it is possible to link a specified location within a different web page.
9b. Explain how forms are processed in Client side and server side
9c. Explain how to Access a Form’s Control Values with an example.
10a. Write a note on :Document Object Model
10b. Develop a JavaScript code that displays text “HTML5” with increasing font size in the
interval of 100ms in RED COLOR, when the font size reaches 50pt it displays “HTML” in
BLUE color. Then the font size decreases to 5pt.
<html>
<body>
<p id="demo">
</p>
<script>
var var1 = setInterval(inTimer,1000);
var size = 5;
var ids = document.getElementById("demo");
function inTimer(){
ids.innerHTML = ' HTML 5 ';
ids.setAttribute('style',"font-size:"+size+"px: color:blue");
size +=5;
if(size>=){
clearInterval(var1);
}
}
</script>
</body>
</html>
10c. Explain popular controls and the elements of forms used JavaScript
1a. List and explain most common elements used in (X)HTML documents
1b. What do mean by Document Type Definition (DTD). Write the basic structure
(X)HTML documents derived from the specifications.
1c. Name the rendering modes of Modern Web browsers. How browser typically
chooses in which mode to parse a document.
8. Myth: (X)HTML Is the Most Important Technology Needed to Create Web Pages
No, it is also one of the technologies available, in addition to it, so many other readymade applications
which are flexible and with more features are available for the same purpose.
3a. Why few HTML4 Elements Removed from HTML5? Give the Removed
HTML Elements list and also CSS alternatives.
3b. Write the snippet of code to demonstrate the following semantic inline elements (i)
Indicating Dates and Time (ii) Inserting figures.
<figure> element is used to add self-contained content, like illustrations, diagrams, photos,
code listings, etc.
The <figcaption> tag defines a caption for a <figure> element.
The <figcaption> element can be placed as the first or as the last child of a <figure> element.
The <img> element defines the actual image/illustration.
4c. Mention the rules to remember while mappings between markup and script.
5b. Suppose you want to apply CSS to text that doesn‟t coincide with any of the HTML5
elements. What should you do? Give an illustrative example.
If a piece of text does not coincide with the HTML5 elements, it cannot be styled with CSS.
However, there are other methods that can be used to add styling to text.
For example: by using <span> element, we can group elements and style them with CSS.
5c. What are the different methods used specify the RGB Values for Color explain any one of
them.
6a. Discuss font-style, font-variant, font-weight properties of CSS.
6b. Explain Text-align, text-decoration, text-transform, and text-indent properties of CSS.
7a. Give the code to create a webpage with the output as shown below.
7b. Explain different href attribute values and their jumping effects
7c. Mention and briefly describe the Common formats for web page bitmap image files.
8a. What is the need of Responsive web design (RWD)? Explain resolutionswitching
with an example.
8b. Illustrate the situation in which webpage designer thiks of CSS rule uses the float
property and a value of left or right.Justify how the propety and values are useful in such
situations
8c. What is browsing context? Name the element used to create it.
9a. What is a function in JavaScript? Explain syntax for a function definition with an
example.
9b. List Some of the more popular controls and the elements used to implement them.
9c. Write a Java Script program that on clicking a button, displays scrolling text which moves
from left to right with a small delay.
10a. Explain text control attributes.
10b. Write a note on reset and focus Methods
10c. Create a webpage containing 3 overlapping images using HTML, CSS and JS. Further
when the mouse is hover any image, it should be on the top and fully displayed.
<html>
<head>
<style>
#imagecontainer { position: absolute; padding: 10px; width: 300px; height: 300px;}