18 Questions
What is the correct order of precedence for applying CSS styles?
Inline styles, Internal styles, External styles
Which type of CSS selector is used for styling elements by their class?
Class selector
In CSS, which styling method is used to include styles within the HTML document itself?
Internal styles
What is the correct syntax to reference an external CSS file within an HTML document?
Which CSS style construct is used to define formatting for specific elements based on their ID?
Id selector
When using CSS to style a web page, what does specificity refer to?
The hierarchy of styles that determines which style gets applied to an element
What is the purpose of the pseudo-class selector :hover?
To apply a style to an element when it is hovered over
What is the difference between a class selector and an ID selector?
A class selector can be applied to multiple elements, while an ID selector can only be applied to one element
What is the effect of the CSS code .t1 { text-align: center; }
?
It centers the text of the element with the class 't1'
What is the purpose of the :focus pseudo-class selector?
To apply a style to an element when it is focused
What is the effect of the CSS code p.subheader { font-weight: bold; color: #593d87; }
?
It sets the font weight and color of the paragraph element with the class 'subheader'
What is the purpose of an intersection selector?
To select an element that matches multiple selectors
What is the correct way to define a style rule for h1, h2, and h3 elements with a color of blue?
h1 h2 h3 { color: blue; }
In CSS, what is the correct way to style a div with class 'footer'?
.footer { color: blue; }
Which CSS property is used to set the font size and font family of the body element?
font
How can you define a style for links specifically when they are being hovered over?
a:hover { color: blue; }
Which CSS property would you use to set a border around an HTML element?
border
If you want to set the background of a webpage with an image that doesn't repeat, how would you do it in CSS?
body { background-image: url('image.jpg'); background-repeat: no-repeat; }
Test your knowledge on compound selectors in web authoring and design with this quiz. Identify correct union selectors, multiple elementary selectors combined with comma, and descendent selectors in CSS.
Make Your Own Quizzes and Flashcards
Convert your notes into interactive study material.
Get started for free