curriculum/challenges/english/blocks/quiz-basic-css/66ed8fa2f45ce3ece4053eab.md
To pass the quiz, you must correctly answer at least 18 of the 20 questions below.
What does CSS stand for?
Cascading Style Script
Concatenating Style Script
Castor Sage Style
Cascading Style Sheets
Which of the following is a correct CSS rule?
p=red
p (color: red)
{p color: red;}
p {color: red;}
What does <meta name="viewport"> do?
It links external stylesheets to a webpage for responsive design.
It specifies the metadata used by search engines to index a webpage.
It specifies the character encoding used on the webpage.
It controls the shape and size of a web page on different screen sizes.
Which syntax is correct to use inline CSS?
<p color = blue></p>
<p><style = blue></p>
p {color: blue;}
<p style="color: blue;"></p>
When using internal CSS, where is the style element placed within the HTML?
In the meta element.
In the script element.
In the body element.
In the head element.
Which rule is correct for setting the width and height in CSS?
height-width: 50px;
width-and-height: 50px;
flex-width: 50px; flex-height: 50px;
width: 50px; height: 50px;
Which selector correctly targets h1 elements only when inside a div?
div, h1 {}
div ~ h1 {}
div + h1 {}
div h1 {}
Which selector is correct to target direct children of a footer?
footer ~ ul {}
footer + ul {}
footer ul {}
footer > ul {}
Which selector is correct to target the next sibling of an img?
img h1 {}
img > h1 {}
img ~ h1 {}
img + h1 {}
Which selector is correct to target all siblings preceded by an img element?
img > caption {}
img caption {}
img + caption {}
img ~ caption {}
What statement is TRUE about block-level elements?
Block-level elements stack horizontally by default.
width and height properties usually do not apply to block-level elements unless you set their display property to inline-block.
Block-level elements cannot contain inline elements inside them.
Block-level elements start on a new line and take up the full width of their container.
What statement is TRUE when using the inline-block value?
Elements stack vertically, always taking up the full width of their container.
Elements align horizontally but cannot apply vertical padding or margin.
Elements respect width and height settings but cannot contain other elements inside them.
Elements retain inline flow but allow setting width and height.
Given the following selectors, which has the highest specificity?
div
h1
p
#id
Given the following selectors, which has the lowest specificity?
#id
.class
div h1
h1
What does the * selector do?
Targets some elements on the page.
Targets elements that have children on the page.
Targets all p elements on the page.
Targets all elements on the page.
What does !important do in CSS?
It makes the CSS rule work exclusively for inline styles and ignores styles defined in external or internal stylesheets.
It disables all other CSS properties applied to the same element, effectively making it the only rule that affects the element's styling.
It applies on to a certain selector or group of elements.
It overrides any other values applied to the property for that selector.
How does the CSS Cascade algorithm work?
It determines styles of the element based on order of declaration, regardless of other factors.
It applies styles based solely on the order they are written, ignoring specificity.
It applies styles prioritizing specificity, ignoring origin and relevance.
It determines styles of the element based on specificity and order of declaration.
Which rule applies 32px of margin to all sides?
margin-top: 32px;
margin: 32px 0;
margin: 0 32px;
margin: 32px;
Which rule applies 24px padding to the top and bottom?
padding: 24px;
padding-top-bottom: 24px;
padding: 0 24px;
padding: 24px 0;
For padding: 10px 20px 30px 40px, what is the correct order of values?
Right, Top, Left, Bottom.
Top, Left, Bottom, Right.
Top, Bottom, Right, Left.
Top, Right, Bottom, Left.
What are the main parts of a CSS rule?
Elements and attributes
Style and sheets
Scripts and values
Selectors and declaration blocks
Which of the following is the correct syntax for a CSS rule?
body [
font-family: Arial;
]
font-family {
body: Arial;
}
body {
font-family; Arial:
}
body {
font-family: Arial;
}
What are default browser styles?
HTML elements that have the same styling properties regardless of the browser.
They are mandatory styles that you must use for specific HTML elements.
They are the color themes for the various browsers.
The CSS rules that browsers apply automatically.
What is the default value for the width property?
none
0
100%
auto
What does the min-height property specify?
The starting height for an element.
The height for an element.
The maximum height for an element.
The minimum height for an element.
Which of the following is TRUE about the universal selector *?
It has the highest specificity because it can style all the elements on a page.
It contributes 1 to all parts of the specificity value.
It cannot reset styles across different browsers.
It has the lowest specificity value of any selector.
Which selector correctly targets li elements for an ordered list?
li {}
ul li {}
ol + li {}
ol li {}
Which selector targets the paragraph elements of a div element?
p div {}
div, p {}
p, div {}
div p {}
Where does the margin apply styling properties?
The space inside element.
Between the content and the border.
On the border of the element.
The space outside the element.
Where does the padding property apply styling?
Between the elements border and the surrounding elements.
The space outside the element.
On the border of the element.
The space inside the element.
Which statement is FALSE about block-level elements?
They can stretch to fit the width of their container.
Common block level elements include div, paragraph, and section.
Block-level elements start on a new line and take up the full width of their container.
They cannot take up the full width available as they are blocked from doing so.
Which statement is FALSE when using the inline-block value?
inline-block elements behave like inline elements.
They can have width and height properties.
Elements retain inline flow but allow setting width and height.
They do not share properties with inline or block level elements.
Which is TRUE about the !important keyword?
They are used to make comments for an important CSS property.
They make sure a CSS property has the correct syntax.
They make CSS rules easier to maintain.
They override the specificity of other selectors.
What character precedes a class selector name?
#
$
*
.
Which is FALSE about inline level elements?
They take up only as much space as they need.
They do not start on a new line.
Common inline elements include span and img.
They always start on a new line.
Where are internal CSS styles accessed?
They are styles that are important to the project, so are not shared externally.
Since they form the core styling of the project, they are saved in the styles.css file so other web pages can access them.
They are stored inside the body element when there is only one web page to style.
They are written within the style section within the head element.
What is the order for applying the padding property when using the shorthand syntax?
top, bottom, left, right
left, right, top, bottom
right, top, left, bottom
top, right, bottom, left
What is the order for applying the margin property when using the shorthand syntax?
left, right, top, bottom
right, top, left, bottom
top, bottom, left, right
top, right, bottom, left
What are inline CSS styles used for?
They are used to style inline elements only.
They are used to style elements only when they all appear on the same line of the browser viewport.
They are used to resolve the issue with separation of concerns.
They are used to directly style within the element, instead of using internal or external CSS.
What symbol precedes the ID selector?
.
*
$
#