In style.css, write a selector for p elements that also have a class of .time

guys please help me out. what am I doing wrong here?

1 Like

.time p will select all paragraphs within all element which has class time, for example:

<!-- html code -->
<div class='time'>
   <p>i am affected, given there is a parent element with class timeD</p>
<p>i am not affected, i don't have a parent element with class time</p>
/* css */
.time p { color: grey; }

this is what your current css code does, selecting any paragraph element within elements which have class time

However, the exercises ask you to target all paragraph elements which have class time

so, we need to change the css syntax, how could we do this?

1 Like

i don’t know. hooooowwww?

this must have been explained somewhere? Maybe in the exercise itself? Otherwise this would be an impossible exercise

we could change the css selector to: p .time, this will select all elements with class time within paragraph, still not entirely right. What causes that it to select the elements with class time within the paragraph elements? The space between the css selectors, so what would happen if we remove the space from between the css selectors?


i removed the space, i seem to have tried everything. please help i’m desperate

that should work, unless you made a mistake somewhere else in your css code or the <link> is missing and the html code is not aware of the css, please post full html and css code

1 Like

i contacted them, and the tech guy suggested writing it without the space between them

please give me:

the exercise url
your full html code
your full css code

so i can have a proper look

1 Like

the issue is solves, but i can send u the link to the exercise task 5

the hint says:

To select elements with a specific class, chain the class selector to the end of the element selector.

which was my suggestions: p.time {property: value}, that should solve the issue

good to hear that its solved

1 Like

i didn’t understand the was Not a space

the chaining selectors was explained, as i thought:

and then in the next exercise, the nested selectors:

I would highly recommend you to visit this exercises again, hopefully this will make you understand why you need p.time to target the right paragraph in your project

1 Like