It online Exam

Sunday, 27 August 2017

Lesson No. 1 Web Publishing Short-Long Ques. Answers



Lesson No. 1 Web Publishing

1. What do you mean by Frames. Explain <frame>, <frameset> and <noframe> tags.  
FRAMES are used to divide the browser window into several parts through which we can see more than one web page at a time. Each HTML document is called frame.
A frame is an individual, independently scrolling region of a web page.
To create frames, tags used are: 1. <frameset> 2. <frame>

<frameset> tag
·         It is a container tag for defining frames.
·         It replaces the <body> tag in frameset documents
·         It defines how to divide the window into frames.
·         Each frameset defines a set of rows or columns.
·         To divide screen horizontally we use rows.
·         To divide screen vertically we use cols.

The rows/cols values indicate the amount of screen area, each row/column will occupy
Attributes of frameset tag
i) Rows : It divides the screen into horizontal frames.
ii) Cols : It divides the screen into vertical frames.
Values of area can be given in % or pixels or by relative value using * (asterisk) symbol.

<frame> tag
It is used to create frame within frameset. It defines what HTML document to put into the frame.
Attributes of <frame>
Name : assigns a name to the frame.
Src : specifies the html page you want to display.
Frameborder : specifies the border around frame. By default value is 1. 0 value for no border.
Marginwidth : sets left an right margins.
Marginheight : sets top and bottom margins.
Noresize : This attribute prevents the user from resizing the frame.
Scrolling : specifies whether to display scrollbar. It can have one of the three values : YES, NO, AUTO.

<noframes> tag
The <noframes> tag is a fallback tag for browsers that do not support frames. It can contain all the HTML elements that you can find inside the <body> element of a normal HTML page.
The <noframes> element can be used to link to a non:frameset version of the web site or to display a message to users that frames are required.
The <noframes> element goes inside the <frameset> element.




2. Explain the <iframe> tag along with its attributes.
An inline frame is a frame that is displayed in a box within a web page. <iframe> tag is used to create inline frame. The inline frame can display images or web pages within it.
Attributes of <iframe>
Attribute
Value
Description
src
URL
Specifies the address of the document to embed in the <iframe>
align
Left / right / top middle / bottom
Specifies the alignment of an <iframe> according to surrounding elements
frameborder
1 / 0
Specifies whether or not to display a border around an <iframe>
height
pixels
Specifies the height of an <iframe>
longdesc
URL
Specifies a page that contains a long description of the content of an <iframe>
marginheight
pixels
Specifies the top and bottom margins of the content of an <iframe>
marginwidth
pixels
Specifies the left and right margins of the content of an <iframe>
name
text
Specifies the name of an <iframe>
scrolling
Yes /no auto
Specifies whether or not to display scrollbars in an <iframe>
width
pixels
Specifies the width of an <iframe>

3. Explain <img> tag along with its attributes.
The <img> tag is used to insert image on a web page. The various attributes of <img> tag are as follows:
Src – Specifies the location of the image.
Alt – provides alternate text for the image. If the image is not loaded in the web page alternate text is displayed.
Height – Specifies the height of the image given in pixels or percentage.
Width – specifies the width of the image given in pixels or percentage.
Border – Specifies the width of the border around an image.
Align – specifies the alignment of the image. The values are left, center or right.
Hspace – Specifies the amount of white space to be left on left and right side of an image.
Vspace – Specifies the amount of white space to be left on top and bottom side of an image.

4. Explain Image Mapping. Explain its two types.
IMAGE MAPPING
It is a single graphic image that consists of number of hyperlinks incorporated within an image. The specific areas mapped within an image are known as hotspots which are links to a resource.
Map contains the information of an image and the mapped areas of an image. These areas can be rectangles, circles or polygons defined in an image specified by coordinates in pixels of the image.

There are two ways to do image mapping

1) Client Side mapping : They are executed on client machine from web browser itself. All information is loaded along with the image. It executes quickly. In Client side mapping, the image map is mentioned by using USEMAP attribute in the <img> tag. The map is specified in the <map> and <area> tags, which defines the hotspot in an image. For specifying the areas of the hotspot, the <area> tag is used within <map> tag.

2) Server side mapping : In this the program that executes the links is placed on the server. The browser activates program on the server by sending x and y coordinates of the position where hyperlink was created. On receiving the coordinates the program on the server looks at the map file for close match and then loads the file that is closet to coordinates. In Server side mapping, the image map is mentioned by using ISMAP attribute in the <img> tag. The map details are save in a text file with the extension .map and place this file in the same folder in which html document containing the image is placed.

5. Explain forms and list the different tags used to construct web form.
A webform, web form or HTML form on a web page allows a user to enter data that is sent to a server for processing. Forms can resemble paper or database forms because web users fill out the forms using checkboxes, radio buttons, or text fields. The HTML <form> element defines a form that is used to collect user input. An HTML form contains form elements.
Form elements are different types of input elements, like text fields, checkboxes, radio buttons, submit buttons, and more.
The list of different tags used to create form elements are:

<form> </form> : container tag for all form elements
<input> tag : To create textbox, password field, radio button, buttons, check box, submit button, reset button using the type attribute. HTML5 added several new input types: color,date, datetime-local, email, month, number, range, search, tel, time, url, week, etc..
<textarea> </teaxtarea> : To create multiline text box. The size of a text area can be specified by the cols and rows attributes, or even better; through CSS' height and width properties.
<select> : used to create a drop-down list. The <option> tags inside the <select> element define the available options in the list.

6. Explain popular audio formats.
Popular Sound/Audio formats:
.WAV - developed by Microsoft and IBM. It is the standard format for Windows.
.AIFF - (Audio Interchange File Format) developed by Apple for MAC platform
.Ra - (Real Audio Format) is lower quality audio format (smaller in size)
.MPEG/.MPG - (Moving Picture Experts Group) popular format used for web. Smaller in size but good quality
.AU - (Audio) developed by Sun Microsystems for UNIX platform
.MIDI - (Musical Instrumental Digital Interface) - format used for instrumental music, very small in size

7. Explain popular video formats. 
Popular Video formats:
.AVI (Audio Video Interleave) - format developed by Microsoft for Windows platform.
.WMV (Windows Media video) - developed by Mircosoft
.QT (Quick Time) - format developed by Apple for MAC platform
.MPG / .MPEG / .MP4 - formats developed by Moving Picture experts group, popular format on web.
.flv - FLV is a file format used by Adobe Flash Player and Adobe AIR for storing and delivering synchronized audio and video streams.
.swf - is a file extension for a Shockwave Flash file format created by Macromedia and now owned by Adobe. SWF stands for Small Web Format. SWF files can contain video and vector based animations and sound and are designed for efficient delivery over the web. SWF files can be viewed in a web browser using the Flash plug in.




8. What is Cross Browser and give examples.
Testing your website on different browsers is knows as Cross Browser Testing. Cross Browser Testing is a process to test web applications across multiple browsers. It involves checking compatibility of your application across multiple web browsers and ensures that your web application works correctly across different web browsers. It involves testing both the client side and server side behavior of your Web application when it is accessed using different Web Browsers. It shows limitation of the web site and functional features.
Examples:
1. <bgsound> tag is only supported by Internet Explorer and not by Netscape Navigator, Chrome, Firefox, Opera, etc..

2. Broken image - an image in a web page whose path is not found or path is wrong or file name is given is wrong. Internet Explorer shows broken images with a red color sign along with alternative text. In Netscape Navigator, it shows 3 color dots with alternative text.

3. <hr> tag Horizontal rule - The appearance is different in browsers. In Internet Explorer it shows 3D effect, whereas in Netscape Navigator it show rule (line) in regular manner.

4. bordercolorlight and bordercolordark - attributes of tag are supported in Internet Explorer but not supported in Netscape Navigator.
5. bgproperties=fixed - This attribute used in tag makes background image water marked in Internet Explorer, but moves with text in Netscape Navigator.
6. Outset Border - Outset border style given to paragraph tag is shown in Internet Explorer and not in Netscape navigator.
7. <blink> tag is not supported in Internet Explorer and other browsers which blinks the text, but supported in Netscape Navigator.

9. What is Unicode?  
·         Unicode is a computing industry standard for the consistent encoding, representation, and handling of text expressed in most of the world's writing systems.
·         It is a standard character set encoding developed and maintained by The Unicode Consortium.
·         It can support over one million characters.
·         It supports all characters from all scripts, as well as many symbols.
·         Unicode also knows as UTF-8 (Unicode Transformation Format-8) or the Universal Alphabet.
·         Today all the web browser and operating systems includes Unicode support.

10. What is CSS? Explain ways to include CSS in web pages. 
·         CSS stands for Cascading Style Sheets, used for styling of a web page.
·         CSS describes how HTML elements are to be displayed on screen, paper, or in other media
·         CSS saves a lot of work. It can control the layout of multiple web pages all at once
·         CSS is used to define styles for your web pages, including the design, layout and variations in display for different devices and screen sizes. 




There are three ways of inserting a style sheet:
1)  External style sheet
With an external style sheet, you can change the look of an entire website by changing just one file!
Each page must include a reference to the external style sheet file inside the <link> element. The <link> element goes inside the <head> section:
An external style sheet can be written in any text editor. The file should not contain any html tags. The style sheet file must be saved with a .css extension.
Example:
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
Here is how the "myStyle.css" looks:
body {    background-color: lightblue;   }

h1
{
    color
: navy;
    margin-left
: 20px;
}
2) Internal style sheet
An internal style sheet may be used if one single page has a unique style.
Internal styles are defined within the <style> element, inside the <head> section of an HTML page:
Example:
<head>
      <style>
      body
{              background-color: linen;         }

      h1
{
            color
: maroon;
            margin-left
: 40px;
      }
      </style>
</head>
3) Inline style
An inline style may be used to apply a unique style for a single element.
To use inline styles, add the style attribute to the relevant element. The style attribute can contain any CSS property.
The example below shows how to change the color and the left margin of a <h1> element:
Example:
<h1 style="color:blue;margin-left:30px;">This is a heading.</h1>



11. What is Web Server?  
A Web server is a program running on a Computer that uses HTTP (Hypertext Transfer Protocol) to serve the files that form Web pages to users, in response to their requests, which are forwarded by their computers' HTTP clients (Web Browsers).
Web server is a computer that hosts websites and web pages i.e. where the web content is stored.
A web server consists of a physical server, server operating system (OS) and software used to facilitate HTTP communication like IIS, Apache, etc.
When you type a Web site address into your browser, Web servers are doing the work of getting you the page you request.

Every Web server has an IP address and possibly a domain name.
Examples of Web Server Programs:
  • Microsoft Internet Information Services (IIS)
  • Microsoft Personal Web Server (PWS)
  • Apache HTTP Server
  • Sun Java System Web Server
  • Lighttpd

12. Write a note on CGI Scripting?  
CGI stands for Common Gateway Interface. It is a standard for interfacing external programs with an HTTP server. CGI is a part of the HTTP protocol. It is set or rules resident at web server. It provides path or way for the web page to communicate with the web server. CGI converts data input and formats the data so that the browser can display the result.

CGI programs are used to publish and process forms so that readers can submit comments, order a product, or search for information from a web page.

Important applications of CGI are :  Information display, User counting, Web Search Engines, Indexing the content, CGI e-mail services, etc.

Monday, 24 July 2017

Lesson No. 1 Web Publishing - Web Server

What is Web Server?



A Web server is a program running on a Computer that uses HTTP (Hypertext Transfer Protocol) to serve the files that form Web pages to users, in response to their requests, which are forwarded by their computers' HTTP clients (Web Browsers).

Web server is a computer that hosts websites and web pages i.e. where the web content is stored.

A web server consists of a physical server, server operating system (OS) and software used to facilitate HTTP communication like IIS, Apache, etc.


When you type a Web site address into your browser, Web servers are doing the work of getting you the page you request.

Every Web server has an IP address and possibly a domain name.


Examples of Web Server Programs:

  • Microsoft Internet Information Services (IIS)
  • Microsoft Personal Web Server (PWS)
  • Apache HTTP Server
  • Sun Java System Web Server
  • Lighttpd




Lesson No. 1 Web Publishing - CSS



What is CSS?
  • CSS stands for Cascading Style Sheets
  • CSS describes how HTML elements are to be displayed on screen, paper, or in other media
  • CSS saves a lot of work. It can control the layout of multiple web pages all at once
  • CSS is used to define styles for your web pages, including the design, layout and variations in display for different devices and screen sizes. 
  • External stylesheets are stored in CSS files


CSS Syntax

A CSS rule-set consists of a selector and a declaration block:
CSS rule syntax


  • The selector points to the HTML element you want to style.
  • The declaration block contains one or more declarations separated by semicolons.
  • Each declaration includes a CSS property name and a value, separated by a colon.
  • A CSS declaration always ends with a semicolon, and declaration blocks are surrounded by curly braces.

Example:
p {
    color
: red;
    text-align
: center;
}


Three Ways to Insert CSS
There are three ways of inserting a style sheet:
  • External style sheet
  • Internal style sheet
  • Inline style



1.  External Style Sheet

With an external style sheet, you can change the look of an entire website by changing just one file!
Each page must include a reference to the external style sheet file inside the <link> element. The <link> element goes inside the <head> section:
An external style sheet can be written in any text editor. The file should not contain any html tags. The style sheet file must be saved with a .css extension.
Example:
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>

Here is how the "myStyle.css" looks:
body {
    background-color
: lightblue;
}

h1
{
    color
: navy;
    margin-left
: 20px;
}


Note: Do not add a space between the property value and the unit (such as margin-left:20 px;). The correct way is: margin-left:20px;


2.  Internal Style Sheet

An internal style sheet may be used if one single page has a unique style.
Internal styles are defined within the <style> element, inside the <head> section of an HTML page:
Example:
<head>
        <style>
        body
{
                background-color
: linen;
        }

        h1
{
                color
: maroon;
                margin-left
: 40px;
        }
        </style>
</head>

3.  Inline Styles

An inline style may be used to apply a unique style for a single element.
To use inline styles, add the style attribute to the relevant element. The style attribute can contain any CSS property.
The example below shows how to change the color and the left margin of a <h1> element:
Example:
<h1 style="color:blue;margin-left:30px;">This is a heading.</h1>

Note: If some properties have been defined for the same selector (element) in different style sheets, the value from the last read style sheet will be used. 
 



CSS Selectors

CSS selectors are used to "find" (or select) HTML elements based on their element name, id, class, attribute, and more.

The element Selector

The element selector selects elements based on the element name.
Example:

p {
    text-align
: center;
    color
: red;
}

The id Selector

·         The id selector uses the id attribute of an HTML element to select a specific element.
·         The id of an element should be 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.
Example:
#para1 {
    text-align
: center;
    color
: red;
}
<p id="para1">                            
   .....................................................
    ...................................................
</p>

 

The class Selector

·         The class selector selects elements with a specific class attribute.
·         To select elements with a specific class, write a period (.) character, followed by the name of the class.

Example:
.center  {
    text-align
: center;
    color
: red;
}

Grouping Selectors

If you have elements with the same style definitions, it will be better to group the selectors, to minimize the code.
To group selectors, separate each selector with a comma.
Example:
h1, h2, p {
    text-align
: center;
    color
: red;
}

Important CSS properties
Color - The color property specifies the color of text.
Example:
body {
  color: red;
}


h1 
{
  color: #00ff00;
}

Background-image - The background-image property sets one or more background images for an element. By default, a background-image is placed at the top-left corner of an element, and repeated both vertically and horizontally.
Example:

body {
  background-image: url("img_tree.gif"), url("paper.gif");
  background-color: #cccccc;

}

Background-color - Set the background color for a page:
Example:

body {background-color: coral;}

Background - Set different background properties in one declaration for background color, image, position, size, attachment, etc.
Example:

body {
  background: lightblue url("img_tree.gif") no-repeat fixed center;
}

Border - The border property is a shorthand property for:

Example:

h1 {
  border: 5px solid red;
}


h2 
{
  border: 4px dotted blue;
}

Text-align - The text-align property specifies the horizontal alignment of text in an element.
Values are   left|right|center|justify|initial|inherit;
Example:

div {
  text-align: center;
}

Text-decoration - The text-decoration property specifies the decoration added to text, and is a shorthand property for:
  • text-decoration-line (required)
  • text-decoration-color
  • text-decoration-style

Example:

h1 {
  text-decoration: overline;
}


h2 
{
  text-decoration: line-through;
}


h3 
{
  text-decoration: underline;
}


h4 
{
  text-decoration: underline overline;
}

Font - The font property is a shorthand property for:
The font-size and font-family values are required. If one of the other values is missing, their default value are used.
Example:

{
  font: italic bold 12px/30px Georgia, serif;
}

Font-size - The font-size property sets the size of a font.
div {
  font-size: 15px;
}

Font-family - The font-family property specifies the font for an element.
The font-family property can hold several font names as a "fallback" system. If the browser does not support the first font, it tries the next font.
Example:

H2 {
  font-family: "Times New Roman", Times, serif;
}

Font-style - The font-style property specifies the font style for a text. Values are normal|italic|oblique|initial|inherit
Example:

{
  font-style: italic;
}

font-weight - The font-weight property sets how thick or thin characters in text should be displayed.
The values are - normal|bold|bolder|lighter|number|initial|inherit;
Example:

{
  font-weight: bold;
}

letter-spacing - The letter-spacing property increases or decreases the space between characters in a text. The values are normal|length|initial|inherit;
Example:

h2 {
  letter-spacing: 2px;
}


Float - The float property specifies how an element should float.
Example:

img  {
  float: right;
}

Margin - The margin property sets the margins for an element, and is a shorthand property for the following properties:

Example:

{
  margin: 35px;
}
p {
     margin: 10px 5px 15px 20px;
}

Padding - An element's padding is the space between its content and its border.
The padding property is a shorthand property for:
·         Example:

Example:

{
  padding: 35px;
}

z-index - The z-index property specifies the stack order of an element.
An element with greater stack order is always in front of an element with a lower stack order.
Example:

img {
  position: absolute;
  left: 0px;

  top: 0px;

  z-index: -1;

}

Position - The position property specifies the type of positioning method used for an element (static, relative, absolute, fixed, or sticky).
Example:

 h2 {
  position: absolute;
  left: 100px;

  top: 150px;

}

Value
Description
static
Default value. Elements render in order, as they appear in the document flow
absolute
The element is positioned relative to its first positioned (not static) ancestor element
fixed
The element is positioned relative to the browser window
relative
The element is positioned relative to its normal position, so "left:20px" adds 20 pixels to the element's LEFT position
sticky
The element is positioned based on the user's scroll position
A sticky element toggles between relative and fixed, depending on the scroll position. It is positioned relative until a given offset position is met in the viewport - then it "sticks" in place (like position:fixed).
Note: Not supported in IE/Edge 15 or earlier. Supported in Safari from version 6.1 with a -webkit- prefix.
initial
Sets this property to its default value. 
inherit
Inherits this property from its parent element.






Top - The top property affects the vertical position of a positioned element. This property has no effect on non-positioned elements.
Example:

 div {
  position: absolute;

  top: 50px;

  border: 3px solid green;

}