No student devices needed. Know more
15 questions
Why do we use CSS?
HTML wasn’t intended to be able to style web pages, CSS allows
us to add style
Separate the content of a web page from the design of a web page
Easily modify the look and feel of a web site even at a large scale
All of the above
Which of the following is a valid CSS rule?
h1 {
color: blue;
}
style="color:blue;"
css="color:blue;"
h1 {
color {
blue;
}
}
Which of the following code snippets will select all <img> tags on a page and give them a height of 200
pixels?
<img style="height:200px;">
tag="img" {
height: 200px;
}
img {
height: 200px;
}
<img> {
height: 200px;
}
Which of the following code snippets will select all HTML elements with the class “alert” and set their
color to be red?
alert {
color: red;
}
.alert {
color: red;
}
#alert {
color: red;
}
class="alert" {
color: red;
}
Which of the following CSS rules will select the HTML element with the id logo and set the font size for
that element to 60 pixels?
logo {
font-size: 60px;
}
.logo {
font-size: 60px;
}
#logo {
font-size: 60px;
}
id="logo" {
font-size: 60px;
}
What is the function of the Cascade in CSS?
The Cascade is a set of guidelines to make your site look beautiful.
The Cascade helps you write styling for your websites quickly by
providing easy templates to use.
The Cascade determines which CSS rules will be applied when
multiple rules for an item are contradictory.
The Cascade will make sure there are no typos in your CSS rules.
True or False: In the case that two conflicting rules have the same order and specificity, the rule that is
written first will be applied.
True
False
In what order does the Cascade look at factors to determine which CSS rule to follow?
Order, Importance, Specificity
Importance, Order, Specificity
Specificity, Importance, Order
Importance, Specificity, Order
Which of the following is a valid CSS rule?
h2 {
color: blue;
}
<h2> {
color: blue;
}
h2 {
color="blue";
}
h2 {
color=blue;
}
CSS rules have a selector that defines which HTML elements the rule applies to.
We’ve learned about the following CSS Selectors:
*Select by tag name
*Select by class name
*Select by id name
Which of the following ranks the selectors from highest precedence to lowest precedence?
Select by tag name, select by class name, select by id name
Select by id name, select by tag name, select by class name
Select by id name, select by class name, select by tag name
Select by class name, select by id name, select by tag name
Which of the following statements are true about styling your web pages with CSS:
I. Styling with CSS is more scalable than using style= on each HTML tag that you want to style
II. You can create styles with CSS that are not possible using style= on an HTML tag
I only
II only
I and II
Neither I nor II
Suppose you have written a web page using HTML and CSS and it is hosted at the URL
yourdomain.com/home.html
Which of the following statements is true about which devices can view your website?
Only browsers on desktop computers can view your website
because only desktop browsers can render HTML based web
pages.
Only browsers on mobile phones can view your website because
only mobile browsers can render HTML based web pages.
Only computers made after the day you publish your website can
view your website. Older computers can’t understand HTML and
CSS.
Any browser on any device will be able to view your webpage,
because all browsers and devices on the Internet agree to use the
same protocols for sending, receiving, and viewing webpages.
Suppose you have the following CSS rules:
p {
color: green;
}
.fire {
color: red;
}
#title {
color: blue;
}
What font color will the following HTML element have after being styled by the given CSS:
<h1 class="fire">Welcome!</h1>
red
green
blue
black
Suppose you have the following CSS rules:
p {
color: green;
}
.fire {
color: red;
}
#title {
color: blue;
}
What font color will the following HTML element have after being styled by the given CSS:
<p class="title">My First Paragraph</p>
red
blue
green
black
Suppose you have the following CSS rules:
p {
color: green;
}
.fire {
color: red;
}
#title {
color: blue;
}
What font color will the following HTML element have after being styled by the given CSS:
<p class="fire" id="title">Hello World!</p>
red
blue
green
black
Explore all questions with a free account