Quiz
Chapter 2: Cascading Style Sheets
Create a free account to finish this quiz
Save your progress and see your final score.
Already have an account? Sign in
Questions in this quiz (31)
1An HTML element defines the _____of a document while the CSS determines the ____
- Atitle .... content
- Bformatting .... appearance
- Ccontent ... appearance
- Dappearance....content
2A CSS definition includes three parts:
- Aa selector, a property and a value
- Balignment, color, and value
- Cred, green and blue
- Dselector, color, and value
3Where in an HTML document is the correct place to refer to an external style sheet?
- A<style> and </style>
- B<css> and </css>
- C<head> and </head>
- D<body> and </body>
4Which of the following measurements is a relative one?
- A% and px
- Bem and in
- Cpx and in
- D% and em
5If you want to define different styles for the same selector and use them in different places, you can use ____ selector.
- Anumbering
- Bclass
- Cdifferent
- Dspecial
6How do you add a background color of red to all h1 elements?
- Aall h1{background-color:red;}
- Bh1.all{background-color:red;}
- Ch1{background-color:red;}
- Dbackground-color{h1:red;}
7How do you select an element with id "myColor"?
- AmyColor
- B#myColor
- C.myColor
- D*myColor
8How do you apply CSS to a group of selectors?
- Aseparate each selector with space
- Bseparate each selector with a dot
- Cseparate each selector with a comma
- Dseparate each selector with an asterisk
9How do you select all p elements inside a div element?
- Adiv, p
- Bdiv p
- Cdiv.p
- Ddiv#p
10How do you select all p elements as a child of a div element?
- Adiv, p
- Bdiv p
- Cdiv. p
- Ddiv>p
11Which of the following CSS will override the browser default style?
- Aembedded
- Bexternal
- Cinline
- Dall of the above
12Suppose you have a linked style sheet file named "lesson1.css" that is saved in the same folder as you HTML document. In order to apply the style to the HTML document, you need to insert the following line of code in the _________ section of an HTML file:
<link href="lesson1.css" type="text/css" rel="stylesheet"/>- A<head>
- B<body>
- C<p>
- Dspecific location where the element is
13Suppose you want to apply CSS to more than one Web pages, you probably will use _____CSS
- Aembedded
- Bexternal
- Cinline
- Dbrowser default
14If you use the embedded style, all the CSS definitions should be included inside_______ element.
- A<style> and </style>
- B<css> and </css>
- C<definition> and </definition>
- D<cssDefinition> and </cssDefinition>
15Which HTML attribute is used to define inline styles?
- Astyle
- Bcss
- Cinline
- Dinlinestyle
16CSS inheritance means ______.
- Aif you apply a property to one element, the property will apply to all related elements.
- Bif you apply a property to one element, the property will apply to all nested elements.
- Cif you apply a property to one element, the property will apply to all related elements with some exceptions.
- DCSS is not object-oriented, and thus no such thing as inheritance,
17Which of the following is a correct way to comment out a line of CSS Code?
- A/*This is a line of comment
- B<?This is a line of comment
- C<?This is a line of comment?>
- D/*This is a line of comment*/
18In CSS color, the RGB stands for ______________?
- Aa really good background
- Bred gray blue
- Cred green blue
- Dred green black
19Which of the following is NOT a valid RGB color?
- A#ff0000
- B#f00
- Crgb (256,0,0)
- Drgb(100%,0%,0%)
20Which CSS property is used to change the text color of an element?
- Atext-color
- Bfont-color
- Cforeground-color
- Dcolor
21CSS can be specified in three ways. When more than one style information is specified for an HTML element, these styles cascade into a new style sheet by following the cascading order. From highest priority to the lowest priority orders are:
- Aembedded, external, and inline
- Binline, embedded, and external
- Cembedded, inline, and external
- Dexternal, embedded, and inline
22Which CSS property determines the text size?
- Atext-size
- Bfont-size
- Ctext-style
- Dfont-style
23What is the CSS definition for making all the <p> elements bold?
- Ap{font-size:bold;}
- Bp{font-style:bold;}
- Cp{text-size:bold;}
- Dp{font-weight:bold;}
24What is the CSS definition for displaying hyperlink without an underline?
- Aa{underline: none;}
- Ba{text-underline: none;}
- Ca{text-decoration: none;}
- Da{text-decoration: no-underline;}
25How do you make each word in a paragraph start with a capital letter?
- Ap{case: uppercase;}
- Bp{case: first-letter;}
- Cp{text-transform: uppercase;}
- Dp{text-transform: capitalize;}
26Which CSS property is used to change the font of an element?
- Afont
- Bfont-family
- Ctext
- Dboth A) and B)
27How do you display a border for all paragraphs?
- Ap{border: solid 1px red;}
- Bp{border-style: solid 1px red;}
- Cp{border-visible: solid 1px red;}
- Dp{display:solid 1px red;}
28Which CSS property is used to change the left margin of an element?
- Amargin-left
- Bindent
- Cpadding-left
- Dspace-left
29CSS padding property allows negative value
- Atrue
- Bfalse
30How do you make a list without its bullet points?
- Aul{list-style-type:none;}
- Bli{list-style-type:none;}
- Cul{list-style-type:disappear;}
- Dli{list-style-type:disappear;}
31What is the default value of the position property?
- Aabsolute
- Brelative
- Cfixed
- Dstatic
Information
- Description
- Sanchez, L. (2017). Web Programming with HTML, CSS, Bootstrap, JavaScript, JQuery, PHP, and MySQL . CreateSpace Independent Publishing Platform.
- Author
- Rebecca Walton
- Language
- English
- Views
- 59
- Tags
- Rating
- No ratings yet Rate this quiz