BSC CS FY - 3 - Web Technology
BSC CS FY - 3 - Web Technology
If you are using an empty paragraph tag like this <p> </p> it will create new line
If you have extra spaces in between your words the browser ignores that, extra spaces are automatically
ignored throughout the html except appeared in <pre> tag. If you want extra space after it or if this is
what you want as the formatting for all paragraphs, use if you want extra space in between text.
Paragraph tag is basic text formatting tag which specifically used to create multiple line of text.
Paragraph Tag Attributes
align – Align is used to apply aligning to the text as left, right, center.
o Ex: <p align=”right”>Text</p>
Any text between the pre tags, including spaces, carriage returns and
punctuation, will appear in the browser as it would in a text editor (normally
browsers ignore multiple spaces, new line enter key press)
Using the PRE tag to define sections of the page as formatted by the typing
itself was a quick and easy way to get the text to display as you expected it to.
This is because pre- formatted text is defined as text in which the structure is
defined by typographic conventions rather than by the HTML.
Typical HTML ignores more than one white space and carriage returns in the
document. This means that carriage returns, spaces, and tab characters are
all ignore. If you typed the above quote into a typical HTML tag like the P
tag, you would end up with one lineof text:
Try the PRE tag on your website with various different spacing and carriage returns.
For example, try pasting the following code into your web page HTML (leave the
spaces exactlyas they are written):
Code with PRE tag: Output:
<pre> A
A P
P P
P L
L E
E </pre>
The PRE tag leaves the whitespace characters alone. So line breaks, spaces, and tabs are all
maintained in the browser.
b) FTP Protocol:
1) Ans: FTP Protocol:
The File Transfer Protocol (FTP) is a standard network protocol used to transfer computer
files between a client and server on a computer network. The original specification for the
File Transfer Protocol was written by Abhay Bhushan, he is the author of the File Transfer
Protocol (which he started working on while he was a student at IIT-Kanpur).
FTP is state-full connection protocol that means FTP is built on a client-server model
architecture and uses separate online live data connections between the client and the
server. FTP by default use port number 21.
The first FTP client applications were command-line programs but now it developed for
newer operating systems which had graphical user interfaces like windows, and are still
worked with most Windows, MAC, Unix, and Linux operating systems.
c) Span Tag:
Ans:
The HTML <span> tag
It is used for grouping and applying styles to inline elements. Span used on single part of data
where div used for group portion of data.
In HTML, span and div elements are used to define parts of a document so that they are
identifiable when no other HTML element is suitable. While other HTML elements such as p
(paragraph), em (emphasis) and so on accurately represent the effect of the content, the use of
span and div leads to better accessibility for readers and easier maintainability for authors.
Where no existing HTML element is applicable, span and div can valuably represent parts of a
document.
Span tag represents an inline portion of a document, for example words within a sentence.
Div tag represents a block-level portion of a document such as a few paragraphs, or an
image with its caption.
There is a difference between the span tag and the div tag. The span tag is used with inline
elements whilst the div tag is used with block-level content.
Example
<html>
<head>
<title>HTML span Tag</title>
</head>
<body>
<p>This is a paragraph <span
style="color:#FF0000;">
This is a paragraph</span>
This is a paragraph</p>
<p><span style="color:#8866ff;">
This is another paragraph</span></p>
</body>
</html>
d) Heading Tags.
Ans:
Heading tag - <h?>Text</h?>
One of the earliest means of formatting text was the heading tag. It is available in six levels of
importance from <h1>down to <h6>, If you have documents with genuine headings, then there
are HTML tags specifically designed just for them.
They are h1, h2, h3, h4, h5 and h6, h1 being the biggest of headings and h6 being the smallest
Program: Output:
<html>
<head><title>Font Size
Example</title></head> This is a main big heading
<body> This is a main sub heading
<h1>This is a main big heading </h1> This is a sub heading
<h2>This is a main sub heading </h2> This is a heading
<h3>This is a sub heading </h3> This is a small heading
<h4>This is a heading </h4> This is a smallest heading
<h5>This is a small heading </h5>
<h6>This is a smallest heading </h6>
</body>
</html>
Note that the h1 tag is only used once - it is supposed to be the main heading of the page and
have bigger and bold text appearance. h2 to h6 can used repeatedly, but they should always be
used in order, For example, h4 should be a sub-heading of an h3, and h3 which should be a sub-
heading of an h2.
e) Font tag.
Ans:
The <font> Tag :
Fonts play very important role in making a website more user friendly and increasing
content readability. Font face and color depends entirely on the computer and browser
that is being used to view your page but you can use HTML <font> tag to add style,
size, and color to the text on your website. The font tag was brought in early in HTML’s life
to allow designers to change the size, typeface and color of their text.
Font Attributes
1. Size:
You can set content font size using size attribute. The range of accepted values is from
1(smallest) to 7(largest). The default size of a font is 3.
2. Font Color: You can set any font color you like using color attribute. You can specify
the color that you want by the color name for that color.
3. Font Face: Choose a different font face by specifying any font you have installed. Font
face is synonymous with font type. You can set font face using face attribute but be
aware that if the user viewing the page doesn't have the font installed, they will not be
able to see it. Instead user will see the default font face applicable to the user's computer.
As a web designer, be aware that if you specify a custom font type and users viewing the page
don't have the exact same Font installed, they will not be able to see it. Instead the chosen font
will default to Times New Roman. To reduce the risk of running into this situation, you may
provide a list of several fonts with the face attribute, such as outlined below.
WWW:
Full form of www is world wide web and it is an advanced finding information system. It is
being developed very fast. WWW is based on hypertext System.
The concept of the Web was invented at CERN (European Council for Nuclear Research) in
1992 by Tim-Berners Lee, He is the father of the Web or Internet.
The principle of the Web is based on using hyperlinks to navigate between documents (called
web pages) with software called a Web Browser. A web page is a simple text file written in a
markup language (called HTML) that convert the layout of the document, graphical elements,
and links to other documents, all with the help of tags.
Besides the links which connect formatted documents to one another, the web uses the HTTP
protocol to link documents hosted on distant computers (called web servers). On the www,
documents are identified with a unique address, called a URL, which can be used to locate any
resource on the internet, no matter which server may be hosting it.
A URL looks something like this:
http://www.mywebsite.com/webfolder/Home.html
Which means, when the user is browsing on the www he can put up a word or expression within
a text and request for more information about it.
WWW can be started by the command www. then domain name of the website and finish with
top-level domains .com or .in etc Ex: www.mywebsite.com
Advantages: Disadvantages:
1. You can find all type of information 1. Online data not secure
2. You can purchase things online 2. Hacking
3. You can watch or listen to media 3. You can get computer virus infections
4. You can play online games 4. Online fraud.
5. You can check your online bank Etc…
account
6. You can find friends, etc…
g) Mail to anchor.
Ans:
Creating Email Hyperlinks (using mail to anchor):-
Although links to and within web pages are the most common types of links you’ll create, you
can also link to other types of content on the Internet.
E-Mail Addresses
When you want to give someone easy access to your e-mail address, you can include it on your
page as a mailto link. This means instead of using http://in front of your link, you use the e-mail
protocol mailto:to preface your e-mail address.
Clicking this link in a browser causes the visitor’s e-mail program to launch. Then it opens a new
e-mail message and places your e-mail address in the To: box of that message.
NOTE :
- For a mailto link to work, visitors to your web site must have an offline e-mail program
(such as Microsoft Outlook or Mac Mail) set up on their computers. E-mail links like
these may not work if the visitor uses only a web-based e-mail service such as Gmail or
Hotmail.
- There actually is not a separate HTML tag for creating an HTML email link.
Email Link:
- By adding a couple extra onto the email address in href you can have both the SUBJECT
and the BODY of the email automatically populated for your visitors. This is great when
receiving emails from a website to an email account that handles more mail than just
from that one link on your site.
- By defining a uniform subject that people will automatically have when clicking the link
you will be able to tell right away whether or not an email came from the website or from
another source (as long as your visitors don't mess with the subject that you give them).
- Subject - Insert the subject of the email with the information that you provide.
- Body - Insert the body of the email with the information that you provide.
Complete email HTML Code:
Mailto: The anchor <A> tag can also be used for enabling emailing, which helps visitors to send
feedback through your web site. This is all fine as long as the visitor has his email client
configured to send emails. However, if this is not the case, his computer will inform to him about
it and the email will not be sent till an email client is configured.
Using the mailto value along with an email address in the HREF attribute of the anchor tag will
create a link, which when clicked will open the default email client email compose window with
already filling to part then subject part and body part with above data.
Basic Tags:
There are four basic tags: 1.<HTML>, 2.<HEAD>, 3.<TITLE>, 4.<BODY>
1. <HTML> :
<HTML> tag is a main tag contains all other tags which is a structure and
skeleton of HTML code.
The first tag in your html document is <html>.This tag tells your browser that this
is the start of an html document. The last tag in your document is </html>.
This tag tells your browser that this is the end of the html document. This is the
standard structure tag of an HTML. Make sure that you use <HTML> element at
once in whole html page it never repeat and placed in between code more than
one time.
It is compulsory kind of tag to make web page. Html contains all other basic tags
which is head, title, body.
2. <HEAD> :
The <head> element is just a container for all other header elements. It
should be the first thing to appear after the opening <html> tag. <head> element
should contain a <title> element indicating the title of the document.
Other tag under head: <script>, <style>,<link>.
3. <TITLE> :
<TITLE> tag is used to display webpage title name. Page titles are very useful to
know just what subject data is on your website. There can only be one title per
page.
Please note that this is one of the tags that will go within the HEAD tags. It
displays at the very top of a browser window.
4. <BODY> :
The <body> element appears after the <head> element and contains the part of the
Web page that you actually see in the main browser window, which is
sometimes referred to as body content.
All tags which apply some effects to text, image or anything that means
everything you seen and appearing on web page that are placed between under
<body> tag and </body> tag.
The address element isn’t used for the purpose that you may expect—that being to mark up a
physical location alone. Instead, it’s used to indicate the contact point for the document in which
it appears. This element would usually appear in a header or footer on the page.
An address element may contain a geographic location, but it doesn’t have to; it could also
contain a mixture of contact points. In the example shown, the address element includes an email
point of contact, a mailing location, and a telephone number.
The basic purpose to write postal address in <address> tag is to find our address webpage in
google search engine easily, because search engine software always searches our address text
with the help of <address> tag.
The contact details of the “XYZ College” are marked up with address in this example:
<address> Name of the XYZ College: <br>
Used For …
This element is used to represent contact related information to the user like Address, Email,
Fax, Mobile, Contact number.
Introduction to lists
List tag is to create lists in web page. HTML offers some tags for specifying lists of information.
All lists must contain one or more list elements (items).
Lists are especially useful in web pages to draw attention to short pieces of information. Keep
that in mind when you create your lists, and try to include short phrases, instead of long
sentences, in each list item.
Program:
<html>
<head>
<title>Font Size Example</title>
</head>
<body>
<ol type="I">Courses:
<li> BCA </li>
<li> BSc(CS)</li>
<li> BSc(SE)</li>
<li> BBA</li>
</ol>
</body>
</html>
Output:
Courses:
I. BCA
II. BSc(CS)
III. BSc(SE)
IV. BBA
Initially, all unordered lists default to the disc style, which is usually represented as a small,
filled-in circle. However, if you nest unordered lists—that is, if you include an unordered list in
another unordered list—the default value changes.
Output:
HTML:
Hypertext Markup Language is the web scripting language used to create documents for the
World Wide Web.
Attributes:
Settings of the movement using below
attributes:
1) behavior: If no value is specified, the default value is
Sets how the text is scrolled within themarquee. scroll.Ex. <marquee
Possible values are behavior=”slide”>TEXT</marquee>
1. scroll 2. slide 3. alternate.
In 1989, Berners-Lee developed the hypertext system that could be used as an interface to
access scientific information and this information displayed equally well on different computers
as like Macintosh systems, NeXT Workstations, IBM PCs with Windows OS. This system was
based on software technology which was worked on a various server computers available in
network.
Berners-Lee developed the first versions of HTML, at first he concentrate on sharing the
content and structure of the system and then later he considered the presentation. Hence, first
webpage had become as static webpage. Hypertext documents are navigating using Hyperlinks.
Berners-Lee developed a system to access multiple data to visit single web page, that system
later called as World Wide Web.
In 1989: Developed hypertext system.
In 1990: Developed a text mode browser to access hypertext system.
In 1991: Hypertext system was implemented officially at CERN.
In 1992: Hypertext system named as WWW (World Wide Web)
In 1993: Graphical browser Mosaic used to run www.
In 1994: Most Popular Browser Netscape Navigator used to run www.
In 1995: Microsoft’s Internet Explorer used to run www.
The HTML anchor element is used to create a link to a resource (another web page, a file, etc.)
or to a specific place within a web page.
Syntax: <a href=”path&filename.extension”> text </a>
Example: <a href=”www.mywebsite.com/home.html”> text </a>
The anchor tag alone won't do anything without an attribute and value, so let's look at the
attributes we can use.
HREF Attribute:
Href is short for hypertext reference. To create a link, you have to know the web address url of
the file you want to link to, whether it's another web page of your own site, another website, or a
link to file such as a PDF document, sound file, image, or another type of file.
The href part, shown in dark blue text with underlined. This is the attribute that defines the
address of the file you want to link to.
The equal sign always connects an attribute to the attribute's value. So in this case, href is the
attribute, and http://www.google.com is the value. The value is always enclosed in quotation
marks.
Click here to visit Google is the anchor text, or sometimes called the link text. This is the part of
a link that is clickable.
If you link to a page on another site you need to use the full web address as shown in the
example above. If you're linking to a different page on your own same site you only need to use
the page name and extension if the page is keep in the same directory.
For example, suppose you want to link to a page you've saved with the name of HomePage.html.
You'd code it like this:
<a href="HomePage.html">Home Page</a>
By linking to your own internal pages without using the full web address your pages will load
faster. If you use the full web address the browser goes back out to the Internet to find your site
all over again, which takes longer. If you don't use the full path the browser only checks on your
site for the file.
File names, which includes the name of the web page and the extension, are case sensitive. That
means you must use the same capitalization in the web address of the file that was used when the
file was saved.
TARGET Attribute
The target attribute allows you to determine where the link will open. With a framed site, it
allows you to target a link to a specific frame. The most common use is to have off-site links
open in a new browser window or new tab in same browser window. Target attribute specifies
the target window for a hypertext source link that references frames. The information linked to
target will be displayed in the named window.
_blank : it open clicked web url webpage in new window of web browser;
_self : Opens the linked document in the same frame as it was clicked (this is default);
By adding the part target=”_blank” to a link, the link will open in a new window or a new tab,
depending on the browser in use and how it's configured.
Ans:
Web Browser:
HTML is simply collection of codes, code means it is collection of some meaningful symbols
which is having some structure and format to create a web document. Those structured
combination of symbols are only recognized by special software called as web browser, web
browser can read HTML symbolic program structure and displays a suitable human readable
form on display screen.
The web pages are written in HTML language in the form of code but whenever you open that
HTML web page in web browser software you don’t see html code, it displays a formatted and
readable data. Web page is a document, typically written in plain text mixed together with
formatting instructions (tags) of Hyper Text Markup Language (HTML). Web pages are
accessed and transported outside the computer in internet with a protocol called as HTTP (Hyper
Text Transfer Protocol)
Protocol is tiny software which defines rules and regulations to transfer data and
communicate another computer across the internet.
Web browser supports numerous protocols such as HTTP, FTP, TELNET, etc…
Web browser perform various task as like file downloading, file uploading, email attachment,
save web page content, play videos from website, print webpage etc. It also bookmarks
(saving address of a web page in web browser) your favorite web page.
1. Mosaic: Mosaic was older browse, it was first graphical web browser. Mosaic was
developed at the National Center for Supercomputing Applications and released the
browser in 1993.
2. Netscape Navigator: It was first released in 1994. Mosaic was developed with another
name netscape navigator. This is the first most popular commercial web browser in older
days
3. Microsoft Internet Explorer: Microsoft is a software company which designed and
developed a web browser for windows operating system named as Microsoft Internet
Explorer. It is present default as web browser in any newly installed windows operating
system. Today this is one of the most usable browser on internet.
4. Mozilla Firefox: After days creator of Netscape navigator developed a new browser
called Mozilla Firefox. Firefox is rapidly gaining ground right behind internet explorer
because of its tabbed browsing, superior security features, and fast loading web page.
5. Google Chrome: Google specialized in web search engine it is a copyright product of
Google. It is a light weight and fast accessing browser.
6. Mac Safari: Macintosh (Mac) is a computer system of Apple company. Safari is a web
browser works on Macintosh OS. It has a rich graphical appearance.
7. Opera: It is popular mobile web browser and also available in desktop PC.
c) Define DHTML.
Ans:
Introduction of DHTML:
1. HTML
2. JavaScript - the Web's standard scripting language
3. Cascading Style Sheets (CSS) – Making web page more attractive.
4. Document Object Model (DOM) -- a means of accessing a document's individual elements
- The application of DHTML was introduced by Microsoft with the release of Internet
Explorer 4 in 1997.
We put HTML tags (paragraphs, images, etc.) in a specific order in the source code. The browser
always showed all elements in this order. Positioning and styling was done by tables, div's and
such aids. If we wanted to change the order or the positioning of the elements, we had to rewrite
the HTML.
DHTML gives us the chance to re-organize our pages. In fact, we can take some tags out of the
natural flow (Default behavior) of the page. The natural flow of the page is the page as the
browser first shows it. It calculates the tables and paragraphs and other things we put in the page,
then displays them in the best possible way, one by one, from the beginning to the end of the
HTML document.
It provides a richer, more dynamic experience on web pages, making them more like dynamic
applications and less like static content.
1) HTML: we have been using attributes, tags, and generating HTML in a structured
fashion. HTML defines the structure of a Web page, using such tags as headings, forms,
tables, paragraphs and links.
4) Document Object Model (DOM): The Document Object Model. This means that we are
developing a model in which the document or Web page contains objects (elements,
links, etc.) that can be manipulated. So you will be able to delete, add, or change an
element (as long as the document is still valid, of course!), change its content or add,
delete or change an attribute.
With the Document Object Model, programmers can build documents, navigate their structure,
and add, modify, or delete elements and content. Anything found in an HTML document can be
accessed, changed, deleted, or added using the Document Object Model.
Ans:
The Role of Images on the Web – The Img tag & it’s all attributes:-
The image tag is used to place an image on the web page. Place image inside the page content is also
called as inline image.
<img src="image1.jpg"></img>
In this example the two files are both located in the same folder. The HTML file includes an image tag
which refers to image1.jpg.
When the HTML file is displayed in a browser, it requests the image file and places it on the page where
the tag appears.
As you can see, the most important attribute of the image tag is src, which means source and tells the
browser where the image file is.
The size define the width and height of the image. They look like this:
If your image is present on c drive of your computer then you have to mention c:\ in front of image name
in src attribute. These attributes are optional but strongly recommended as to set the size of width and
height for image.
You can mention width and height attribute values either in Percentage or in Pixel value such as
3) Alt Attributes
These two attributes are very similar and can be confusing. Basically, it makes sense to treat them as the
same thing and use them both.
Alt attribute define a short piece of text which appears instead of the image if the image cannot be
displayed (for whatever reason), and as a "tool-tip" when you hold your mouse over the image it appears
as text.
4) Align attribute:
5) Border attribute:
The border attribute places a border around the image. In the following example a 1-pixel border is
applied:
If no border attribute is specified, no border is applied, except when the image is used as a hyperlink. In
this case a 1-pixel border is applied. If you want to make an image into a hyperlink without a border,
specify a zero border like so:
1) BORDER:-
Border attribute is used with <TABLE> tag to display lines around rows and columns.
BORDER attribute can take value depending upon the thickness of the border that you want,
value can start with 0 to increased order (0 value represent no border,1 thin border, 5 Thick
border and so on…).
Ex. <TABLE BORDER=”1”>
2) BORDERCOLOR:-
The BORDERCOLOR attribute sets color to the border of the table.
This attribute takes name of color or the equivalent hexadecimal value.
Ex. <TABLE BORDER=”1” BORDERCOLOR=”RED”>
3) BGCOLOR:-
To change the background of the entire table BGCOLOR attribute is used.
BGCOLOR attribute takes the value as name of color or its equivalent hexadecimal value.
Ex. <TABLE BGCOLOR=”PINK”>
4) ALIGN:-
We can align the table to left, right or center location. Table Cell
By default, tables are displayed at left margin. Left Center Right
ALIGN attribute take values as LEFT, RIGHT or CENTER.
Ex. <TABLE ALIGN=”CENTER”>
6) WIDTH:-
WIDTH attribute defines how table appears on the screen with horizontal increment of size.
Width can be given a value either absolute width in pixel such as <TABLE WIDTH=”300”> or
width in percentage value such as <TABLE WIDTH=”50%”>.
Ex-<TABLE WIDTH=”300”>
7) HEIGHT:
Height attribute defines how table appears on the screen with vertical increment of size.
Width and Height can be given a value either absolute width in pixel such as <TABLE
HEIGHT=”200”> or height in percentage value such as <TABLE HEIGHT=”20%”>.
Ex-<TABLE HEIGHT=”20%”>
8) CELLPADDING:-
Cellpadding is the value that determines the amount of spaces within each cell border and its
content data. It tells the browser that how much space to provide between border and text or data
within the cell.
It is placed in the <TABLE> tag with a value defined in pixels.
Ex-<TABLE BORDER=”1” cellpadding=”5”>
9) CELLSPACING:-
Cellspacing is used to create space in between all cells in a table.
Use of cell spacing also effects on spacing of the entire table.
Ex-<TABLE cellspacing=”5”>
10) COLSPAN:-
These attributes are used to span (Expand in space) multiple number of columns.
COLSPAN attribute is used with<TH>, <TD> tags.
COLSPAN attribute is used to create a cell that have size of two or more cells of different
columns, that means visitor thought it merges the two or more cells of different columns
in a single cell of column.
COLSPAN increase or span cell in horizontal way.
COLSPAN attribute takes numeric value i.e. how many cells in a column you want to
merge.
11) ROWSPAN:-
These attributes are used to span (Expand in space) multiple number of rows.
ROWSPAN attribute is used with <TH> and <TD> Tags.ROWSPAN attribute is used to
create a cell that have size of two or more cells in different row, that means visitor
thought it merges the two or more cells of different rowsin a single cell of column.
ROWSPAN increase or span cell in vertical way.
It takes the numeric value i.e how many cells you want to merge and make a single cell.
Advantages of JavaScript:
1. Less server interaction − you can validate user input before sending the page off to the
server. This saves server traffic, which means fewer loads on your server. Wrong data
can’t send to server.
2. Immediate feedback to the visitors − they don't have to wait for a page reload to see if
they have forgotten to enter something.
3. Increased interactivity − you can create interfaces that react when the user hovers over
them with a mouse or activates them via the keyboard.
4. Richer interfaces − you can use JavaScript to include such items as drag-and-drop
components and sliders to give a Rich Interface to your site visitors.
Disadvantages of JavaScript:
1. JavaScript cannot be used for networking applications because there is no such support
available.
2. JavaScript doesn't have any multithreading or multiprocessor capabilities.
Client-side JavaScript:
The script should be included in or referenced by an HTML document for the code to be
interpreted by the browser.
It means that a web page need not be a static HTML, but can include programs that
interact with the user, control the browser, and dynamically create HTML content.
The JavaScript client-side mechanism provides many feature For example, you might use
JavaScript to check if the user has entered a valid e-mail address in a form field.
The JavaScript code is executed when the user submits the form, and only if all the
entries are valid, they would be submitted to the Web Server.
Cascading Style Sheets, commonly referred to as CSS, it is a simple design language used to
simplify the process of making web pages presentable.
CSS handles the look and feel/designing 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, and 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.
Types of CSS:
There are three types of CSS:
1. Embedded CSS Styles
2. Inline CSS Styles
3. External CSS Styles
- CSS can be used as external style sheet linked to a document or a set of document, as shown
in the following example. Linked information should be placed inside the <HEAD> tag with
the help of <LINK> tag.
EXAMPLE:
<LINK REL="stylesheet" TYPE="text/css" HREF="newstyle.css">
Advantages of CSS
A feature available as dynamic buttons, commonly called rollover buttons, is one of the first
common examples of dynamic page manipulation using JavaScript, and DHTML.
A rollover button is a button that becomes active when the user positions the mouse
over it. The button may also have a special activation state when it is pressed. To create a
rollover button, you will first need at least two or three images, to represent each of the button’s
states—inactive, active, and unavailable.
To run this concept we need three images, a sample set of rollover image is shown here:
Step 1: Create three images as shown below and give name as shows.
Step 2: Take <a>tag and place <img> tag inside <a> tag then apply onmouseover and
onmouseout event in <a> tag.
Step 3: In order to add this rollover image to the page, simply use the <IMG> tag like
another image it will display image1.jpg.
The idea is to swap the image in and out when the user move mouse cursor over the image the
onmouseover event will occur and image2.jpg will appear and when mouse pointer switch back
from the image onmouseout event will occur and image3.jpg will appear. By literally swapping
the value of the SRC attribute, you can achieve the rollover effect. This will happen dynamically
without manually change any code and refresh or reload a web page.
Output Effect: This will show effect as like image of ABOUT will blink as per action from
white background to black background but technically image is not blinked but two individual
images are swapping on action.
Checkboxes are used when more than one option is required to be selected. They are also created
using HTML <input> tag but type attribute is set to checkbox.
<form> Output:
Select Services: <br>
<input type="checkbox"
name="internet" value="1">
Internet</input>
<input type="checkbox"
name="hostel" value="2">
Hostel</input>
<input type="checkbox"
name="mess" value="3">
Mess</input>
<input type="checkbox"
name="gym" value="4">
Gym</input>
</form>
2) Radio Button Controls :
Radio buttons are single option selection control, it used when out of many options; just one
option is required to be selected. They are also created using HTML <input> tag but type
attribute is set to radio. Name attribute value must be same for all controls.
<form> Output:
Select Status: <br>
<input type="radio" name="status" value="Married ">
Married
<input type="radio" name="status" value="Un-
Married"> Un-Married
</form>
Pull-down menus are great tools to use when you want users to respond with one specific
answer.
Q .5 Write shot note on any THREE of the following (5 Marks each) (15)
a) Text level Element.
Ans:
1) Bold - <b>Text</b>
The text in between the tags will be bold, and stand out against text around it, the same as in a word processor.
Place the bold tag inside other elements to highlight important words and give feeling to your text.
You may also use it to separate words from their meaning in a dictionary fashion.
<p><b>Cardio:</b> Latin word meaning of the heart.</p>
Output:
Cardio: Latin word meaning of the heart.
The idea here is to use the bold tag in quick formatting situations. It is not a good idea to bold entire
paragraphs or other elements simply because you want the text to be larger or fatter.
2) Italic - <i>Text</i>
Also working the same way as a word processor, italics display the text at a slight angle. This tag is used to
make text cursive or running and you can use <i> tag in paragraph. You can make note, comment of author
in website etc using this tag.
<p><b>Cardio:</b> <i>Latin word meaning of the heart.</i></p>
Output: Cardio: Latin word meaning of the heart.
3) Underline - <u>Text</u>
Again, the same as underline in a word processor. If you want to make text underlined and considered to
important then you have to use this tag.
<u><h1>Introduction of
HTML:</h1></u> Output:
Introduction of HTML:
Note that html links are already underlined and don't need the extra tag.
4) Superscript - <sup>Text</sup>
Superscript refer to text that are positioned slightly higher the text on the line. For example, a footnote or
endnote number reference is an example of superscript.
12 <sup>th</sup> or 3 <sup>rd</sup> or E=
mc<sup>2</sup> Output: 12th or 3rd or E=mc2
5) Subscript - <sub>Text</sub>
Subscript refer to numbers that are positioned slightly lower than the text on the line. For example, a scientific
formula might use subscript text.
O<sub>2</sub>
Output: O2
6) Strikethrough - <strike>Text</strike>
Puts a line right through the center of the text, crossing it out. Often used to show that text is old and no longer
relevant. Also works by using <s></s> instead.
EX: This is <strike>Deleted</strike> text and now <s>no longer</s> used.
Output: This is Deleted text and now no longer used.
7) Center - <center>Text</center>
A useful tag, as it says, it makes text, image, table, everything in between the tags centered (in the
middle of the page).
8) Mark - <mark>Text</mark>
This is a tag which appear text highlighted means this text will appear with background yellow color.
EX: <mark>This text will highlighted with yellow background
color.</mark> Output: This text will highlighted with yellow
background color.
b) Varibles in Javascript.
Ans:
JavaScript Variables:
Like many other programming languages, JavaScript has variables. Variables can be thought of as named
containers. You can place data into these containers and then refer to the data simply by naming the container.
- Before you use a variable in a JavaScript program, you must declare it. Variables are declared
with the var keyword as follows.
- Storing a value in a variable is called variable initialization. You can do variable initialization at
the time of variable creation or at a later point in time when you need that variable.
- For instance, you might create variable named money and assign the value 100 to it. Later, for
another variable, you can assign a value with any alphabet name like Suraj.
1. To find information: Now a day people used internet for getting information about anything, someone
wants to read news, watching knowledgeable videos, to know something new.
2. To complete a task: This means doing work on internet such as, email, purchasing online product, filling
scholarship form, online booking, creating online account in any website.
Websites have many functions; a website can be a personal website, a commercial website, a
government website or a non-profit organization website. Websites can be the work of an individual,
a business or other organization, and are typically dedicated to a particular topic or purpose.
A website is stored on a computer system known as a web server, also called as HTTP server.
Types of website:
1 Static Website: Static websites contain static text that is displayed on the screen; it just shows data
content but does not calculate or processed depending upon user input. It has basic presentation and no
database. Ex: College
2 Dynamic Website: A dynamic website changes or customizes itself behavior frequently and automatically
such as user registration form, login form, online shopping websites, Interactive database oriented e-
commerce websites, web-banking websites.
Website has .html file extension. For example, the file name "Home.html".
d) Embedded CSS.
Ans:
Embedded CSS Styles:
- Embedded style always used inside <HEAD> tag, for using embedded css you have to use <style> tag inside
<head> tag, then insert css code in to <style> tag.
- This type of css applies for complete webpage and for all tags, suppose you write a css code for h1, h2, p tag
then all h1, h2 and p tags are available inside that web page are applied by css effect.
- Embedded css is easy way to apply designing for all tags with short and one time written code. That means you
have to write only once as css code in style tag and it applies for all tags so it’s a short cut method to write
designing code.
- Suppose after developing a web page, customer wants to make changes as like color of a h1 then you can easily
change the code of css and fulfill the requirement of customer.
Note: userInput is a valid JavaScript variable, for understanding with example please look out
below program.
In above variable scope example this statement is used to display value of variable a.
Example:
<html>
<head>
<title>Take Input from User and Give Output to User</title>
</head>
<body>
<input type="text" id="userInput">give me input</input>
<button onclick="test()">Submit</button>
<script type="text/javascript" language="javascript"> function test()
{
var uservalue= document.getElementById("userInput").value;
document.write(uservalue);
}
</script>
</body>
</html>