Quiz Css Fundamentals

CSS Fundamentals Quiz

CSS stands for Cascading Style Sheet.

TRUE
FALSE

It is impossible to validate CSS to check if it is correct.

TRUE
FALSE

Which of the following code demonstrates a CSS comment?

// This is a comment in CSS
/* This is a comment in CSS */
<!-- This is a comment in CSS -->
# This is a CSS comment

Which is the correct (and most specific) CSS selector statement to select the text inside the HTML element and change the text color to red in the following example:

<p>Lorem Ipsum</p>

p > { color: red }
p { text-color: red; }
p { color: red; }
None of the above.

Which is the correct (and most specific) CSS selector statement to change the text color of the first <li> element to red in the following example:

<ul>
   <li class="redtext">Gravy</li>
   <li>Turkey</li>
   <li>Potato</li>
</ul>

.redtext { color: red; }
#redtext { color: red; }
li > redtext { color: red; }
None of the above.

Which is the correct (and most specific) CSS selector statement to select the text inside the HTML element and change the text color to red in the following example:

<div id="media">
   Lorem Ipsum Dolores.
</div>

.media { color: red; }
div > media { color: red; }
#media { color: red; }
None of the above.

You can apply multiple CSS IDs to the same element.

TRUE
FALSE

You can apply multiple CSS Classes to the same element.

TRUE
FALSE

In the following example, p is a:

p { color: red; }

Selector
Property
Value
Declaration

In the following example, color: red; is a:

p { color: red; }

Selector
Property
Value
Declaration

In the following example, color is a:

p { color: red; }

Selector
Property
Value
Declaration

In the following example, red is a:

p { color: red; }

Selector
Property
Value
Declaration

In the following example, which is the correct (and most specific) CSS selector statement to select all of the descendents <li> inside of <ul id="salsa"> and style their text color red?

Note: only style <li> inside <ul id="salsa">, NOT <li> elsewhere in the page.

<ul id="salsa">
   <li>Hot</li>
   <li>Medium</li>
   <li>Mild</li>
</ul>

ul li { color: red; }
#salsa li { color: red; }
li.salsa { color: red; }
.salsa #li { color: red; }

Which is the correct (and most specific) CSS selector statement to select the text inside the HTML element and change the text color to red when the user hovers over it with their mouse?

<a href="index.html">Home</a>

#hover { color: red; }
a.hover { color: red; }
a:hover { color: red; }
None of the above.

The Developer Tools can be used to see the given CSS styles applied to a specific element and can be used to preview style changes in the browser.

TRUE
FALSE

View CSS Fundamentals Quiz on Learn.co and start learning to code for free.

Unlock your future in tech
Learn to code.

Learn about Flatiron School's Mission

With a new take on education that falls somewhere between self-taught prodigy and four-year computer science degree, the Flatiron School promises to turn students with little programming experience into developers.

In the six months since the Manhattan coding school was acquired by WeWork, it has spawned locations in Washington, D.C., Brooklyn, and London. Now, WeWork is opening a fourth Flatiron School location, this time in Houston.

Adam Enbar, Flatiron School's cofounder, believes now is the time to grow. "How the world is changing has impacted working and learning in very similar ways. We think education fundamentally is about one thing: enabling people to pursue a better life."

Learn. Love. Code.
Students come to Flatiron School to change their lives. Join our driven community of career-changers and master the skills you need to become a software engineer or a data scientist.
Find Us