Chapter-5 (DHTML & CSS)

Exercise
 
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 mono-space

 

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

 

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.
► normal 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.
► capitalization

 

12. The _______________ property describes the background color of browser window.
► background-color

 

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.

5. List down the various font-family property? Give an example of each.

Answer

The various font family property are:

6. What do you mean by font-variant? Give example of each.

Answer

The Font-variant property is used to select normal or small-caps variants of a font.


7. Explain font-weight

Answer

Font-weight property describes how bold or “heavy” a font should be presented. A font can either be normal or bold. Some browsers supports the use of numbers between 100-900(in hundreds) to describe the weight of a font.

8. Mention the properties of CSS used to insert Letter spacing in a line.

Answer

Letter-spacing property is used to insert Letter spacing in a line.

9. How many types of text alignments can be included in a CSS page.

Answer

There are three types of text alignments can be included in a CSS page. The text can either be aligned to the left, to the right or center of the screen.

10. How the text in a webpage can be capitalized using CSS properties?

Answer

The text-transform property controls the capitalization of a text. We can choose to capitalizeeffects to be applied on text in the HTML code.

11. Explain the CSS properties to set the foreground and background color of the webpages.

Answer

Color propety is used to set the foreground colour while background-color property is used to set background color of the webpages.

12. Which property of CSS controls the repetition of image inserted in a web page as a background.

Answer

The property background-repeat is used to controls the repetition of image inserted in a web page as a background.