Back to Freecodecamp

CSS Foundations Lesson A

curriculum/challenges/english/blocks/top-learn-css-foundations/63ee351d0d8d4841c3a7091a.md

latest786 B
Original Source

--description--

A type selector (or element selector) will select all elements of the given element type, and the syntax is just the name of the element:

html
<!-- index.html -->

<div>Hello, World!</div>
<div>Hello again!</div>
<p>Hi...</p>
<div>Okay, bye.</div>
css
/* styles.css */

div {
  color: white;
}

Here, all three <div> elements would be selected, while the <p> element wouldn’t be.

--questions--

--text--

Which of the following best describes the CSS code given above?

--answers--

The code applies a white color to all elements in the HTML file.


The code applies a white color to all div elements in the HTML file.


The code applies a white color to all p elements in the HTML file.

--video-solution--

2