computer NCERT Solutions for Class 10th: Ch 5 DHTML & CSS Computer Science

 Homeclass10computer

Excercise

A. Multiple choice questions:

1. Which property describes how bold or “heavy” a font should be presented?
(a) Font style
(b) Font size
(c) Font weight
(d) Font variant
► (c) Font weight

2. The units ‘___’ and ‘___’ allow the user to adjust the font size according to him/her.
(a) ‘#’ and ‘me’
(b) ‘%’ and ‘em’
(c) ‘$’ and ‘es’
(d) All of the above
► (b) ‘%’ and ‘em’

3. The ________________ makes it is possible to add different “decorations” or “effects” to text.
(a) Text Align property
(b) Text Indent property
(c) Letter spacing property
(d) None of the above
► (d) None of the above

4. DHTML is a combination of _________ and __________.
(a) DOM and CSS
(b) CSS and Conventional HTML
(c) HTML and JavaScript
(d) None of the above
► (c) HTML and JavaScript

5.__________________________ is a style sheet language used for describing the look and formatting of a document written in a markup language.
(a) Document Object Model (DOM)
(b) Multimedia filters
(c) Cascading Style Sheets (CSS)
(d) DHTML
► (c) Cascading Style Sheets (CSS)

6. Which property is used to give the specified spacing between the text characters?
(a) Text Decoration
(b) Letter Spacing
(c) Text Transform
(d) None of the above
► (b) Letter Spacing

7. The units ‘px’ and ‘___’ make the font size absolute.
(a) ‘pr’
(b) ‘pn’
(c) ‘pz’
(d) ‘pt’
► (d) ‘pt’

8. The _______________ repeats the image both horizontally and vertically to cover the entire screen.
(a) Background Image property
(b) Foreground Color property
(c) Background Color property
(d) Background Repeat property
► (d) Background Repeat property

B. Fill in the Blanks:

1. Font-family style differentiates between _______,__________ and ________ font faces.
► Serif, Sans-serif and monospace

2. The font-variant property refers to the ___________ variant of the font face.
► lettercase

3. CSS uses a numeric scale of multiples of ______ to _________.
► 100 to 900

4. The CSS specification also allows browser to render any ____ value as normal.
► default

5. The text decoration has to rendered with _____________.
► effects

6. The _____________ property allows you to add effects to text paragraphs by applying an indent to the first line of the paragraph.
► text-indent

7. Font variant property is used to select ___________ or ___________ variants of a font.
► normall or small caps

8. The ______________ property describes the foreground color of a text to be displayed in browser.
► color

9. The property font-style defines the chosen font either in _______, ______ or _________.
► normal, italic and oblique

10. The property _____________ is used to apply prioritized list of fonts in a web page.
► font-family

11. The text-transform property controls the _____________ of a text.
► cpitiallization

12. The _______________ property describes the background color of browser window.
► background-colour
13. The ______________ property is used to insert a background image in a web page.
► background-image

C. Answer the following questions:

1. Explain CSS with reference to DHTML.

Answer

CSS is a style sheet language used for describing the look and formatting of a document written in a markup language. It is a way to provide style to HTML. Whereas the HTML is the meaning or content, the style sheet is the presentation of that document. DHTML is merely a browser feature- or enhancement- that gives your browser the ability to be dynamic. 

2. List some advantages and disadvantages of CSS.

Answer

Advantages of CSS are:
1. It controls layout of many documents from one single style sheet.
2. It has more precise control of layout.
3. It applies different layouts to different media-types.
4. It has numerous advanced and sophisticated techniques to be applied on web pages.

Disadvantage of CSS are:
CSS is very limited in browser compatibility. When you design a web page and you want it to displayexactly as you like it. The problem with CSS is that it displays webpages very differently in the different browsers.

3. What is the extension of a CSS file?

Answer

extension of CSS file is .CSS.

4. Explain how would we embedded Style in your HTML.

Answer

There are three ways to apply CSS to an HTML document. By Inline, Internal or using External style sheet in HTML page.

Inline CSS Example:

In this example, we will change the color and font size of a paragraph element with the help of the “style” attribute.

<!DOCTYPE html>
<html>
 
<head>
    <title>
        Inline CSS
    </title>
</head>
 
<body>
    <h2 style="color: green;
               font-size: 18px;">
        Welcome To GFG
    </h2>
    <p style="color: red;
              font-size: 14px;">
        This is some text. style by inline CSS
    </p>
</body>
 

</html>

Internal CSS:

Internal CSS, also known as embedded CSS, involves adding CSS rules directly within the <style> element in the <head> section of an HTML document. It allows styling specific to that document.

Internal CSS Syntax:

<style>
// CSS Properties
</style>
<!DOCTYPE html>
<html>
 
<head>
    <title>
        Internal CSS
    </title>
     
    <style>
        h1 {
            color: blue;
            font-size: 24px;
            font-weight: bold;
        }
 
        p {
            color: green;
            font-size: 16px;
        }
    </style>
</head>
 
<body>
    <h1>GeeksForGeeks</h1>
    <p>GeeksForGeeks</p>
</body>
 
</html>

External CSS:

External CSS is used to place CSS code in a separate file and link to the HTML document. To use external CSS, create a separate file with the .css file extension that contains your CSS rules. You can link this file to your HTML document using the “link” tag in the head section of your HTML document. 

External CSS Syntax:

<head>
<link rel="stylesheet"
type="text/css" href="style.css">
</head>
In this case, the “link” tag specifies the type of the file (CSS), the relationship between the HTML document and the CSS file (“stylesheet”), and the location of the CSS file (“href” attribute). The href attribute points to the URL or file path of your external CSS file.




<!DOCTYPE html>
<html>
 
<head>
    <title>External Style</title>
    <link rel="stylesheet"
        type="text/css" href="style.css">
</head>
 
<body>
    <h1>GeeksForGeeks</h1>
    <p>GeeksForGeeks</p>
</body>
 
</html>






Create a CSS file named styles.css and write all the codes in that CSS file

File name: style.css

h1 {
    color: blue;
    font-size: 24px;
    font-weight: bold;
}
 
p {
    color: green;
    font-size: 16px;
}

Differentiate between External style sheets and Internal style sheets.

Answer

Differences between External and Internal style sheets are listed below:

S.
No.
External style sheetsInternal style sheets
1.These style sheets are separate .css files.These style sheets are within the HTML document.
2.The CSS file is linked using <link> tag.The style sheet is placed within <style> tags in the <head> section of HTML.
3.It can be used across multiple HTML pages.Its use is limited to a single HTML document.
4.It results in smaller HTML files since styles are in a separate file.It results in larger HTML files as styles are embedded.
5.It is easier to maintain and update styles across multiple pages.Changes require editing each HTML file.

Comments

Popular posts from this blog

CLASS 8 DATA TYPES IN PYTHON

CHAPTER 4 RAISING QUERIES CLASS 8 COMPUTER

HTML 1 TEST ONLINE 20 MAY 2025