class 8 cascading style sheet
Class 8
CHAPTER 7
CASCADING STYLE SHEET
Short answer questions
1.
What is cascading style sheet?
Ans1. CSS is an acronym for cascading style
sheet is a programming specification markup language used for web development. It is a style sheet language which is used
to describe the look and formatting of a document written in markup language.
It provides an additional feature to HTML. It is generally used with HTML to
change the style of web pages and user interfaces.
2.
What is CSS used for?
Ans2. CSS (Cascading Style
Sheets) is used to style and layout web pages — for example,
to alter the font, color, size, and spacing of your content, split it into
multiple columns, or adds animations and other decorative features.
3.
What is the difference between selector and declaration?
Ans3. The selector specifies 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.
For example:-
h3 {color:green, font-size:10px;}
4.
Write the four margin properties in CSS.
Ans4. Following are the four margin
properties in CSS
1.
Margin-top: This property is used to set the top
margin.
2.
Margin-bottom: This property is used to set the
bottom margin.
3.
Margin-left: This property is used to set the
left margin.
4.
Margin-right: This property is used to set the
right margin.
5. How is the
text-align property different from the text-indent property?
Ans5. Text-align property- This text property is used to
align the left, right, center and justify.
For example: letter-spacing:
normal;
Letter-spacing: 3px;
Text-indent property- This text property is used to indent
the first line of text. The values of this property include length or %
(percentage) values.
For example:-
Text-indent: 35px;
Text-indent: 30%;
6. Name the font style properties in CSS.
Ans6. Following are
the font style properties in CSS
1.
Font family
2. Font Size 3. Font style 4. Font variant 5. Font weight
LONG ANSWER QUESTIONS-
1Q1 Explain the div tag using an example
Ans-The div tag is used to define a section
of the document. Using this tag, one can group a large section of HTML elements
together and format them using CSS. This tag allows to define characteristics
for several types of element at once.
EXAMPLE-
<html>
<head>
<title>div
demo</title>
</head>
<body>
<div style=“font-size:
18px;color: red;”>This is div style demonstration! This is div style
demonstration</div>
</body>
</html>
2Q2 Explain internal, external and inline style
sheets.
Ans- Inline style sheet is used to
apply a unique style to HTML element It is applied using the style attribute of
HTML element.
For example- <h3 style-color:green> Type text for
level three heading. </h3>
Internal style sheet is present in
the HTML code document within the <head>….</head> element.
The styles of an internal style
sheet are defined using the <style> and </style> tags. The styles
will be applied to the specific HTML document in which code between the
<style> tags is written.
External style sheet is used when the style is to be applied together to a set of webpages or to a complete website. External style sheet is created in a separate file. All the formatting and layout instructions are typed in this separate sheet and then linked to HTML documents.
4. Write a short note on font properties.
Ans1. The font properties are used to set the font
family, thickness, size and style of text. Some of the font properties are font
family, font size, font style, font variant, font weight etc.
2. What are the border properties? Explain with the
help of an example.
Ans2. Border properties are used to change the
color, style, width and radius of the borders around the elements. The
different border properties are
border-color:blue;
border-width:7px;
border-side-style:dotted;
border-radius:3px;
6. Explain lists in CSS.
Ans6. CSS list properties allow a set different list
item markers for ordered lists and unordered lists. Also one can set an image
as the list item marker along with adding background colors to the lists and
list items. The list style type property specifies the type of list item
marker. Some of the list item markers available for ordered and unordered lists
are
Unordered Lists
Value
|
Description |
None
|
No
bullet |
Disc
|
A
filled in circle |
Circle
|
Empty
Disc |
Square |
A
filled in square |
Ordered Lists
Decimal |
1,2,3,4……. |
Lower-alpha |
a,b,c,d…… |
Upper-alpha |
A,B,C,D… |
Lower-roman |
i,ii,iii,iv… |
Upper-roman |
I,II,III,IV… |
A. Tick the correct option
1. CSS- B. Cascading style sheet
2. D. Variable
3. B. External style sheet
4. A. line-height
5. c. border dotted
B. Fill in the blanks-
1. Style
2. Div tag
3. External
4. Text - Align
5. Font variant
C. Write True or false
1. False
2. TRUE
3. TRUE
4TRUE
5. TRUE
chapter 9
Protecting
your computer
1. d. all of
these (slow processing
speed, loss
of data, reduced disk
space)
2. b. Mcafee
3. b. acid
rain
4. d. Both
a. and b.
(quarantining, repairing)
5. b.
program virus
B. Fill in
the blanks
1. Malware
2. deletes
or modifies
3. boot
sector
4. program
5.
ransomware
true / false
1. TRUE
2. FALSE
3. TRUE
4. TRUE
5. FALSE
SHORT ANSER
QUESTIONS
1. Antivirus
software is a program
that detects
and removes viruses and
other
malware from the computer.
Example-
Avira, AVG, Bitdefender etc.
2.
Ransomware is a malware designed
to lock a
system or a network and
deny access
to them until a ransom
is paid. It
spreads throughout the
system
including the storage devices.
Whereas a
worm is a program that
replicates
itself from one system to
another over
a network. Worm does not
need a host
program to run. Worms are
designed
only to spread from one
system to
another without causing
any harm to
the system files.
They
replicate in large numbers to
consume disk
space or system memory.
LONG
1. What do
you understand by the term
malware and
what are the ways in
which it
spreads?
ans- A
malware is a malicious program
designed in
such a way to damage
computer
files, disrupt the data
stored in it
or steal important
information
from the hard disk.
Malware
spreads in the following ways-
1. By using
an infected pen drive, CD
or DVD.
2. Through
email attachments
3. By
downloading or installing
software/file
infected with malware.
4. Clicking
on any unkown link that
has malware
while surfing the internet
Q2. Write
short note of the following
a. Macro
virus
b. Stealth
virus
c. Trojan
horse
Q3. Explain
three actions performed
by an
antivirus software.
Ans3.
Following are the common action
performed by
an antivirus software
1.
Quarantine- Quarantine means to
isolate an
infected file so that it
cannot harm
other files.
2. Repair-
The antivirus tries to
remove the
virus code and repairs
the infected
file to restore it to
its original
form.
3. Delete-
When a file is damaged or
infected
beyond repair, then an
antivirus
deletes it.
Q4.
Differentiate between spam and
adware.
Ans4. Adware
displays or directs the
users to an
advertisement, while
spyware
performs espionage on the
computer`s activity.
• Adware
operates visible to the user,
while the Spyware operates hidden.
• Generally
adware does not pose
a threat to
the security of the
computer or user information,
while
spyware does and are
categorized
as malicious software.
Q5. Differentiate between a virus
and a worm.
ANS5.(1)
Worms usually spread using a
computer network, whereas viruses
use
executable files to spread from
one system
to others.
(2) Worms
can automatically replicate to
different
systems, while viruses
require
human action to replicate.
(3)The
spreading speed of viruses is
comparatively
slower than worms.
Because
worms can replicate
automatically,
they spread at a much
faster speed.
Q6. List
four tips to keep your
computer
system safe from malware.
Ans6. Best
practices to keep computer
safe are:-
i. Install
an antivirus sofware.
ii. Scan the
computer from time to
time.
iii. Scan
the pen drive or other
external
hard drives before attaching
them to the
computer.
iv. Do not
open emails from an
unkonwn
source.
v. Scan a
software before downloading
or
installing it from the internet.
CLASS 7
INTRODUCTION
TO HTML 5
1. D. <HR> AND <BR>
2. B <TITLE>
3. D
NOTEPAD AND WORDPAD
4. A <H1>
5. A
<B>
Fill in the
blanks
1. Hypertext
2. Container and Empty
3. HTML 5
4. HEAD
5. BODY
1. <TITLE>
The title
element is used to tell the browser that the text within <TITLE> and
</TITLE> tags is the title of the webpage. The Title tag appears on the
title bar of the browser.
2. <h3> The HTML <h3> tag
defines the third level heading in the HTML document. This tag is
also commonly referred to as the <h3> element.
3.
<BR> The <br> HTML element produces a line break in text. It is
useful for writing a poem or an address where the division of lines is
significant.
4. <i>
To
display a part of the text in the italic form on the browser, the HTML
<i> tag is used.
5. <HTML>
The html element is used to tell the browser that the
document is HTML document. Every webpage code must start with <HTML> and
end with </HTML>.
6. <Img> Tag is used to insert
image in a webpage. The <Img> tag is an empty element and creates space
for the image to be inserted.
SHORT ANSWER QUESTIONS-
1. The <p> element is used to mark
a new paragraph. It is a container tag starting with <p> and ending with
</p>.
2. Example of container tags are
1. Paragraph tag <p>..</p>
2. Italics tag <i>…….</i>
Ans3. The
line break <br> tag is used to give a line break. The text written after
this tag appears on a new line. It is an empty tag.
Ans4. Hypertext refers to a word,
phrase or chunk of text that can be linked to another document or text.
Hypertext covers both textual hyperlinks and graphical ones
Ans5- The <!—text --> tag is used to insert comments in
the HTML code. Comments help in code explanation. Comment text is not displayed
in the browser. This is an empty element.
ANS6 CONTAINER AND EMPTY ELEMENT Page 106
LONG ANSWER QUESTION-
ANS1. HTML is a markup language that is used to create HTML
document i.e. webpages. HTML documents can be displayed on the World Wide Web
using web browsers.
Requirement to create HTML document
a. Text editor - Notepad, Wordpad
b. Web browser- Google chrome and opera
Q2. What is
an element in HTML? List five examples.
Ans2. HTML
elements are the basic building blocks of a webpage. Elements give structure to
an HTML document. HTML elements are written using tags. Some elements are
title, headings, body, paragraphs and images.
Q3. Explain
the basic HTML structure in detail.
Ans3. Basic
structure of HTML-
<HTML>
<HEAD>
<TITLE> My first webpage
</TITLE>
</HEAD>
<BODY>
HONESTY IS THE BEST POLICY.
</BODY>
</HTML>
Q4. What is an attribute? Explain with the help of an
example.
Ans4. An attribute defines a property of an element. HTML
elements have attributes and an attribute provides more information about an element
such as height, width, color and so on.
Example- <body bgcolor=”red”>
Q5. Explain how to insert an image into a webpage using an
example. Explain the attributes of the tag.
Ans5. <HTML>
<HEAD>
<TITLE> Inserting image
in webpage </TITLE>
</HEAD>
<BODY>
<Img src=”C:\Users\Documents\Tulips.jpg”>
</BODY>
</HTML>
Attributes of Image tag-
1. Src- It is used to define the
location of the image to be inserted.
2. Alt- It is useful in case an image
cannot be found or not displayed by the browser. In such a case, the browser
displays the text given with this attribute.
3. Width, height- These attributes specify the
size of an image on a webpage.
Q6. Write the attributes used to style or format your text.
Ans6. The style attribute can be linked to any element or
tag. Multiple properties and their values can be given with this attribute for
an element, separated with semicolons.
Example
<p style=”color:red;background-color:aqua”>
Q7. Classify the following into
container or empty elements.
a) <br>
Empty element
b) <title> container element
c) <hr> empty element
d) <h3> container element
e) <p> container element
f) f)
<head> container element
Comments
Post a Comment