0% found this document useful (0 votes)
176 views16 pages

Exercises: Chapter 5: HTML-DHTML and Css

Here is the external style sheet "a1.css" with the specified style: body { font-family: Arial, sans-serif; } 2. Create an internal style sheet with the following specifications: <H1>: C-blue, S-bold <P>: C-green, A-center

Uploaded by

Ruchir Nagar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
176 views16 pages

Exercises: Chapter 5: HTML-DHTML and Css

Here is the external style sheet "a1.css" with the specified style: body { font-family: Arial, sans-serif; } 2. Create an internal style sheet with the following specifications: <H1>: C-blue, S-bold <P>: C-green, A-center

Uploaded by

Ruchir Nagar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

CHAPTER 5: HTML-DHTML AND CSS

Exercises
OBJECTIVE TYPE QUESTIONS
A. MULTIPLE CHOICE QUESTIONS (MCQs)
1. is a style sheet language used for describing the look and
formatting of a document written in a markup language.
a) HTML
b) Java Script
c) CSS
d) DHTML
Ans: c) CSS
2. DHTML is a combination of and .
a) DOM and Static HTML
b) HTML and JavaScript
c) XML and HTML
d) None of the above
Ans: b) HTML and JavaScript
3. Which type of pages gets created from DHTML?
a) Static
b) Dynamic
c) Hyper
d) Global
Ans: b) Dynamic
4. Which of the following HTML Video format is not supported in IE?
a) WebM
b) MP4
c) Ogg
d) All of the above
Ans: c) Ogg
5. Which Boolean attribute specifies that the video will be loaded and repeats the media
(audio/video) file from the beginning when it reaches to end?
a) Autoplay
b) Autobuffer
c) Controls
d) Loop
Ans: d) Loop
6. Which property in CSS wraps block of text and other inline elements around an image?
a) Float
b) Wrap
c) Clear
d) Align
Ans: a) Float
7. Which property in CSS can declare font-weight, font-face & font-size by using only one CSS
property?
a) All Font
b) Font All
c) All
d) Font
Ans: d) Font
8. The external style sheet is linked into the head section of an HTML file using by which tag?
a) <Font>
b) <Title>
c) <Style>
d) <A>
Ans: c) <Style
9. Which css property you will use if you want to add some free space between a border and its
content?
a) Padding
b) Spacing
c) Margin
d) Border
Ans: a) Padding
10. Which of the following defines a measurement in points?
a) in
b) em
c) pt
d) pc
Ans: c) pt

B. Fill in the blanks


1. Font‐family style differentiates between Serif, Sans Serif and Monospace font faces.

2. Full form of CSS is Cascading Style Sheet.

3. The property Font-Family is used to apply a prioritized list of fonts in a webpage.


4. To set the size of a font, Font-Size property is used.
5. DHTML use combination of technologies such as HTML, CSS and Java Script to create interactive
webpages.
6. Cascading Style Sheets (CSS) is a simple style sheet language used to define the look of a
document written in a markup language.
7. CSS is very limited in Browser compatibility as it can display content differently in different
browser.
8. There are three ways to apply CSS to an HTML document. They are Inline, Internal and External
Styles.
9. The outline properties are not supported by IE6 and Netscape 7.
10. The shorthand property for fonts is Font.
THEORETICAL QUESTIONS
A. SHORT ANSWER TYPE QUESTIONS
1. Write the property for the following:
Ans:
a) To add a red‐dotted border around an image: Border-Style.
b) That describes how bold or “heavy” a font should be presented: Font-Weight.
c) To repeat the image both horizontally and vertically to cover the entire screen: Background
Repeat.
d) Defines the background color of browser window: Background-Color.
e) Property that creates a small‐caps effect: Font-Variant.
2. List the advantages of using CSS.
Ans:
 CSS file saves lots of time and work.
 CSS files are easier to maintain as it controls presentation of many documents from one
single style sheet.
 Separate file for style (CSS) and structure (HTML) that makes modification easier as it also
helps to reduce file sizes which helps in faster downloading.
3. List the limitations of CSS.
Ans: CSS limitations are:
 CSS has very limited range in browser compatibility as it can display content differently in
different browsers.
 CSS files has no built‐in security as it is an open text based system, any person having
read/write access to a website can make changes to the CSS file.
4. Differentiate between
a) Font-Weight and Font-Style Properties
b) Embedded Style and External Style
c) Outline Property and Border Property
d) Static and Dynamic Websites
e) Font Family and Generic Family
Ans:
a) Font-Weight and Font-Style Properties
Font‐Weight: Used to make the text bold, normal face.
Font‐Style: Makes the text italic, oblique or normal.
b) Embedded Style and External Style
Embedded style: It is also known as internal style that includes the CSS codes within the HTML
document using the HTML tag <style> in head section.
External style: An external style sheet is a text file with the extension. css.
c) Outline Property and Border Property
Outline property draws a line around elements, outside the border to attract the attention.
It is similar to border except that:
 Outline does not take up any space.
 It always goes same on all the sides; it cannot specify different values.
 It is not a part of the box model.
 An outline may be non‐rectangular.
d) Static and Dynamic Websites
Static websites: These are with fixed content. It allows the viewer to view the same content each
time they visit the website.
Dynamic websites: These are interactive as the content of a webpage can be changed as per the
viewer’s action.

e) Font Family and Generic Family


Font Family Generic Family
The specific name of a font family. The specific name of groups of family‐names
with uniformed appearances.
Font family includes Arial, Times New Roman, Generic family includes five basic types:
Helvetica or Verdana. Cursive, Fantasy, Serif, Sans‐Serif and
Monospace.

Mostly font family names are in the Mostly generic fonts are mentioned at the
beginning of the list. end of list.

5. DHTML is a combination of which technologies? Name them.


Ans: HTML and JavaScript.

6. What is the extension of a CSS file?


Ans: css

7. What does CSS selector mean?


Ans: CSS selector is a string (equivalent of HTML elements) or name of element to which, set of CSS
rules applies to.

8. What are the two parts of ‘ruleset’?


Ans: Ruleset has two parts:
 Selector, e.g., H1 and
 declaration {text‐indent: 11 pt}

9. List the various fonts attributes.


Ans: Various fonts attribute are Font‐Family, Font‐Style, Font‐Size, Font‐Weight and Font‐Variant.

10. How can you add more than one declaration in CSS?
Ans: It can be achieved by using a semicolon.

B. LONG ANSWER TYPE QUESTIONS


1. What do you mean by CSS?
Ans: CSS is a design language used for describing a consistent layout of a webpage. CSS stands for
Cascading Style Sheet, it is part of DHTML (Dynamic Hyper Text Markup Language). CSS describes all
style rule in a stylesheet and that stylesheet document is saved with an extension of .css., which is
linked or imported in an HTML file.

2. What is embedded style?


Ans: Internal (Embedded Style): Internal CSS is defined within the <head> section of an HTML page
under a <style> tag. This internal CSS is defined for complete webpage. Specified formatting styles
will be applied to the body section of that HTML page. Internal CSS used to specify a unique style to
one single page of an HTML document.
Example
<html>
<head>
<style>
body {
background‐color: yellow.
}
h1 {
color: blue
}
p{
color: pink.
margin‐left: 50 px.
}
</style>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph. </p>
</body>
</html>

3. Explain various font-family property.


Ans:
 Font‐Family: Used to change the font name(s).
 Font‐Style: Used to display text normally, oblique or italic.
 Font‐Size: Used to specify font size (xx‐small, x‐small, small, medium, large, x‐large, xx‐
large).
 Font‐Weight: Used to specify how bold or “heavy” a font should be presented (bold, bolder,
lighter).
 Font‐Variant: Used to specify font as normal (Font Variant in normal) or in small‐caps (Font
Variant in small caps).

4. What are the components of a CSS Style?


Ans: A style rule is made of three parts:
Selector − A selector is an HTML tag at which a style will be applied. This could be any tag like <h1>
or <table>, etc. There are several different types of selectors in CSS.
 CSS Element Selector
 CSS Id Selector
 CSS Class Selector
 CSS Universal Selector
 CSS Group Selector
Property − A property is a type of attribute of HTML tag. Put simply, all the HTML attributes are
converted into CSS properties. They could be color, border, etc.
Value − Values are assigned to properties. For example, color property can have value either red or
#F1F1F1, etc.
5. What is the purpose of em measurement unit?
Ans: em – ‘em’ is a relative measurement for the height. Because an em unit is equivalent to the size
of a given font, if you assign a font to 12 pt., each "em" unit would be 12 pt.; thus, 2 em would be 24
pt. Example,
H1 {letter‐spacing: 9 em;}

6. What is the CSS box model and what are its elements?
Ans: The “CSS box model” is a set of rules that defines the layout and design of every element (tag)
on a webpage. In Box model, every element in a page is considered as a rectangular box, they can be
categorized into two:
 Block‐level elements (such as <h1>, <p>, <form>)
 Inline elements (such as <B>, <a>, <img>)
The elements are:
 Content – This is the middle part having text, image or media content.
 Padding – The free space area created between the content and the border.
 Border – The free space area between the box’s padding and margin.
 Margin – The margin CSS property specifies space around the HTML elements. It is
transparent.

APPLICATION BASED QUESTIONS


1. Create an external style sheet ‘‘a1.css’’ with the following specifications:
<BODY>: Font is Courier, Text is in green color
<H1>: Right aligned
<P>: Text is italicized, Font-weight should be bold
Also, write the code of HTML file where this file should be linked.
Ans:
Filename: a1.css
Body
{Font‐family: Courier.
Color: green.
}
h1
{
Text‐align: right.
}
P
{
Font‐style: Italic.
Font‐weight: Bold.
}
Filename: My.html
<html>
<head>
<title>This is Home Page.</title>
<link rel=” stylesheet” type=”text/css” href=”a1.css”/>
</head>
</html>

2. Consider the following CSS code:


P {font-family: arial, comic sans-serif, “Times New Roman”;}
Explain font-family.
Ans: Font‐family prioritize the font to be used in h1 tag. First it will look for arial tag, if it is not
available then the text in h1 will be displayed in comic sans‐serif and if comic‐sans serif font is also
not available then it will display the text in h1 in Times new roman font.

3. Write Code to
a) Make all paragraph elements to be displayed in 'BLUE' color?
Ans: p {color: blue;}
b) To change the foreground color of text to #0000FF in all <H2> tags.
Ans: H2{color: #0000FF;}
c) Display the content of a table in centre.
Ans: TD {Text‐align center;}
d) To set a text font as normal, bold, 30 pt., Arial.
Ans: <p style=”font‐weight: bold; font‐size: 30 pt.; font‐family: Arial;>
CHAPTER 6: CYBER ETHICS
Exercises
OBJECTIVE TYPE QUESTIONS
A. MULTIPLE CHOICE QUESTIONS (MCQs)
1. The copyright symbol is:
a) ©
b) %
c) #
d)
Ans: a) ©
2. Stealing ideas or creations of others is:
a) Piracy
b) Ethics
c) Plagiarism
d) All of the above
Ans: c) Plagiarism
3. Full form of SSL is
a) Simple Socket Layer
b) Secure Socket Layer
c) Server Socket Layer
d) Server Socket Lamp
Ans: b) Secure Socket Layer
4. It allows website to store information about a user on the user’s computer while the user is
browsing the website:
a) Spam
b) Shareware
c) Freeware
d) Cookies
Ans: d) Cookies
5. Program where source code is openly available to use, modification and redistribution without
any restrictions is:
a) Commercial software
b) Public domain software
c) OSS
d) IP
Ans: c) OSS

B. FILL IN THE BLANKS


1. Online ethics are called cyber ethics.
2. Copyright laws protect the creations of writers and artists.
3. Privacy is the protection of personal information given on internet.
4. Intellectual Property is a collection of expressions, literary and artistic work.
5. Trademark is a sign that helps to identify and distinguish the goods of one producer or
enterprise from those of its other competitors.

THEORETICAL QUESTIONS
A. SHORT ANSWER QUESTIONS
1. Write three points in for each of the following categories.
Ans:

Ethical Safety Security Precaution


Cyber ethics is to act and Save from internet threats. Keep your applications and
behave well on the net. Think website updated.
before you speak on net.

No plagiarism. Save digital property. Use copyright, patent,


trademarks, trade secret,
various licenses to protect
from data theft/plagiarism.
Verify the e-mail ID, IP
address, shipping address
using any online software.
Ethics of privacy E-commerce fraud. Check Secure Socket Layer
(SSL) certificates.

2. Write a short note on digital divide.


Ans: Digital divide restrains the freedom of access to information. Digital divide refers to gaps or
the difference between groups in their ability to access ICT (Information and Communication
Technology). The digital divide can be based on various factors, i.e., financial, gender-based,
location (urban and rural), literacy, etc. Digital divide is not healthy for any society. Digital divide
limits the ICT use within the community which leads to unemployment, slows down development
of the country, raise socio-economic issues, etc. Each nation should avoid digital divide. To bridge
the digital divide, following measures can be taken:
a) ICT tools should be promoted.
b) Cooperation between governments, private sectors and non-governmental organizations
needs to be encouraged.
c) Education should be provided to all.
d) Revise government policies and support to get maximum benefits of ICT.
3. What are intellectual property rights?
Ans: Intellectual property (IP) is a collection of expressions, literary and artistic works. This tangible
property can be promoted and protected through IPR (Intellectual Property Rights). Intellectual
property rights can help you to stop people from stealing or copying your original work in the form
of inventions, designs, product or company names, songs, books, etc.

4. Write the full form of the following:


a. FLOSS b. ICT c. FOI d. GUI e. OSI
Ans:
a) FLOSS: Free and Open-Source Software
b) ICT: Information and Communications Technology
c) FOI: Freedom of Information
d) GUI: Graphical User Interface
e) OSI: Open-Source Initiative
5. Define the following terms:
a) Plagiarism b) Patent c) Digital property rights
Ans:
a) Plagiarism: It is copying of another person's ideas and other works while pretending that
they are one's own.
b) Patent: This is an intellectual property right for a fixed time-period, which gives an inventor
the exclusive right to exclude others from making, using or selling his/her invention.
c) Digital property rights: It refers to rights that grant access and control of digital assets or
information such as blogs, website images, video, eBooks or presentations created using
digital devices and are valuable to a company.

6. What is the difference between Shareware and Freeware software?


Ans:

Freeware software Shareware software

Freeware refers to software that anyone can Shareware gives users a chance to try the
download from the Internet and use for free. software before buying it.

Freeware is not copyrighted, and the software Shareware is copyrighted software, initially
is freely available for use (without any license given away on a free basis and a license fee is
fee). Freeware allows redistribution of software payable only after the trial period (such as 30
copies but does not allow to modify the source days trial) or the user have to uninstall it. In
code. Microsoft Internet Explorer (Browser), shareware, software is shared on an honorary
Adobe Reader, Skype are examples of basis for some time. Source code and its
Freeware. modification are not allowed in shareware
rights. Antivirus software and Netflix Trial
Versions are examples of Shareware.
7. What do you mean by e-commerce fraud?
Ans: E-commerce fraud is any type of fraud that occurs on an e-commerce platform. Using a stolen
or fake credit card, using a false identity and affiliate fraud advertising are all forms of e-commerce
fraud.
8. Write two examples for each proprietary software and OSS.
Ans: Proprietary software: Microsoft Office, Adobe Photoshop
OSS: Linux, GIMP, Inkscape
9. Mention the purpose of cookies on internet.
Ans: Cookies allow websites to store information about a user on the user’s computer while the
user is browsing the website.
10. Differentiate between HTTP and HTTPS.
Ans: In HTTPS, ‘S’ signifies security. Hyper Text Transfer Protocol (HTTP) is to provide security for
transmitting data, whereas the website uses Hyper Text Transfer Protocol Secure (HTTPS) to
encrypt the message so that no one in between can read them.

B. LONG ANSWER QUESTIONS


1. What is e-commerce? Mention the advantages and disadvantages of e-commerce.
Ans: Electronic commerce is also known as e-commerce. E-commerce is buying and selling of goods
or services using the internet. Mobile devices have increased e-commerce customers. Mobile
applications such as Amazon, eBay, Paytm, Trivago, Uber, Walmart allow users to do smart
shopping, book cabs or hotels, do online business, transfer money quickly across the globe, etc.
Advantages of e-commerce
 Offers flexibility to the customers: Consumers can avail products round the clock, according
to their comfort, time and location. It saves a lot of time for customers.
 Transit of the purchased goods can easily be tracked (as to when they would reach the
destination). Consumers can register their feedback, rating or complaints directly on the
mobile application or the website. Positive recommendations on the website help increase
sales.
 No geographical limitations: E-commerce provides global access to both the buyer and the
supplier. Consumer can order products from anywhere in the world and similarly suppliers
can promote their products worldwide.
 Economy and e-commerce grow simultaneously through online marketing. Customers can
compare various products and services on the net and get them at affordable prices.
 Environment friendly: Transactions done via e-commerce save paper too.
Disadvantages of e-commerce
 Lack of personal touch: To feel the product before buying is difficult online and should buy
simply by looking at the images. Sometimes a customer also needs personal assistance while
choosing the products which is not possible online.
 Data security could be an issue while buying online. Personal data of customers could be
stolen due to negligence in cyber security.
2. What are the advantages and disadvantages of using e-commerce?
Ans:
Advantages of using e-commerce
a) Consumers can avail products round the clock.
b) It saves a lot of time for customers.
c) Transit of the purchased goods can easily be tracked (as to when they would reach the
destination).
d) Consumers can register their feedback, rating or complaints directly on the mobile
application or the website. Positive recommendations on the website help increase sales.
e) No geographical limitations: E-commerce provides global access to both the buyer and the
supplier. Consumer can order products from anywhere in the world and similarly suppliers
can promote their products worldwide.
f) Economy and e-commerce grow simultaneously through online marketing. Customers can
compare various products and services on the net and get them at affordable prices.
g) Environment friendly: Transactions done via e-commerce save paper too.

Disadvantages of using e-commerce


a) Lack of personal touch. To feel the product before buying is difficult online and should buy
simply by looking at the images. Sometimes a customer also needs personal assistance while
choosing the products which is not possible online.
b) Data security could be an issue while buying online. Personal data of customers could be
stolen due to negligence in cyber security.
3. Name the different kinds of software licensing available.
Ans: Types of software licenses are listed below:
 Commercial software: Commercial software is the proprietary software that must be paid for.
Commercial software has limits on its use, modification and on its redistribution. Those
individuals or organizations that hold a license of that software can only copy, distribute and sell.
Microsoft products and Adobe Photoshop are examples of commercial software.
 Public domain software: Public domain software comes with no copyright concerns. Public
domain software can be used without any restriction. They do not require any license to
download, copy to redistribute. SQLite and I2P are examples of public domain software.
 Shareware: Copyrighted software, initially given away on a free basis and a license fee is payable
only after the trial period (such as 30 days trial) or the user have to uninstall it. In shareware,
software is shared on an honorary basis for some time. Source code and its modification are not
allowed in shareware rights. Antivirus software and Netflix Trial Versions are examples of
Shareware.
 Freeware: Not copyrighted and the software is freely available for use (without any license fee).
Freeware allows redistribution of software copies but does not allow to modify the source code.
Microsoft Internet Explorer (browser), Adobe Reader, Skype are examples of Freeware.
4. How can you protect your intellectual property?
Ans: You can protect your intellectual property through the following rights:
Copyrights: It a legal right to protect and reward literary, dramatic, musical and artistic works that
safeguard creators, producers of films and sound recordings from being stolen by others. No one can
use (copy, display, sell, modify or redistribute) without taking permission from the creators or
authors. Copyright law protection exists automatically when you create an original and unique work.
Copyright symbol is ©. The term of copyright depends on the category of the work protected, and
generally it is of 60 years from the date of creation.

Patent: It is a grant awarded by the respective governments for innovators to prevent their invention
from being used, sold or imported by others. The patent owner can decide how the invention can be
utilized by others. The product or process which needs to be patented should be useful, novel, fall
under the category of the invention in an industry. Plant varieties and original design or patterns (in
jewellery or furniture) can also be patented. The term of every patent is for a limited period of time,
generally 20 years from the filing. In India, to get your inventions patented, you can log on to
www.ipindia.nic.in and fill the e-filling patent form.

Trademarks: It is a sign that helps to identify and distinguish the goods of one producer or enterprise
from those of its other competitors. It protects your sign/name from being used by others. A
trademark can be a single word, symbol, 3D signs and numerals or combinations of these. Trademarks
help in marketing as well as creating a favourable image of a product in the consumer’s mind. The
term of a trademark is initially registered for 10 years (in India) from the filing of an application and
later it can be renewed.

Trade Secret: A trade secret consists of any confidential business method, formula or any information
which provides an enterprise some advantage (economical) over its competitors. India has no specific
trade secret law.

5. What are the advantages of using open-source software?


Ans: The advantages of using open-source software are:
i. It is affordable owing to its lower cost, free to use, distribute and modify. It typically does
not require a license fee.
ii. The software must be available and accessible for anyone to use. Anyone can adapt and
modify OSS according to their business need.
iii. These are better in terms of reliability and quality. OSS are continually developed in real
time by many software engineers.
6. What is netiquette and why it is important?
Ans: Netiquette is a combination of the words, internet or network and etiquette. Netiquette is a
cyber-ethic guideline put forth for proper online communication. Online communication such as e-
mails, chats, instant messaging, video calls, forums, blogs and other social networking sites, if not
clear, can be misunderstood or misinterpreted by anyone. Using the set of netiquette rules,
communication becomes clearer especially in professional dealings. Cyber ethics help to build a
positive online relationship and reputation. Following netiquette rules also help to interact easily
and share information safely online.

7. What is privacy?
Ans: Privacy is a fundamental human right that underpins freedom of association, thought and
expression, as well as freedom from discrimination. A privacy policy on an e-commerce site also
makes customers aware of its terms and conditions about the kind of sharing of PI with associating
companies. A privacy policy should mention the details such as:
 Why and what kind of data is needed and how it will be used or shared.
 Clear ownership (individual/team/company) of the privacy policy.
 The policy’s effective date.
 Proper website link where users can review the description, or the changes made.
 Guidelines to register complaints about the product or services.
 Safety measures taken by the seller. The seller should use various safety measures to
safeguard personal information of customers against loss, theft and unauthorized access,
use and modification.
8. Why Freedom of Information is required?
Ans: Freedom of Information (FOI) describes the right to receive information and ideas held by the
public authorities. It is a right of the general public to avail information from the government as
well as other public sectors. Freedom of Information Act (FOIA) has been made to ensure that
individuals can access records. FOI plays a vital role in a democratic society and increases the
transparency of government sectors.

APPLICATION BASED QUESTIONS


1. Create a poster showing the top five netiquette tips.
Ans: Suggestion for students:
2. Downloading free songs and free movies are ethical or unethical behaviour? Why?
Ans: Downloading any kind of copyrighted material without permission is an unethical behaviour as
according to law it is illegal.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy