Negation pseudo-class

Hello everyone**
Trying to build the Registration form, I have three fieldset elements, and the challenge is to give the fieldset elements a bit of separation, select all but the last fieldset element, and give them a border-bottom of 3px solid #3b3b4f.

The Hint suggets that: You can use the :not(:last-of-type) pseudo-class to select all but the last element.
I have tried to no avail. Iโ€™d be so honored to get some help thank you! :blush::blush:

1 Like

Yes that pseudo-class means it will select all siblings except the very last one.
Example:

The first and second p tag will be selected, leaving out the type of p that is last.
2 Likes

I have tried to no avail.

To get the most out of this topic, itโ€™s better to share your attempts

Yes that pseudo-class means it will select all siblings except the very last one.

As Abee said.

I am going to give you and examples for different pseudo-class to make it clear.

here is a :hover

button {
background: blue;
}

button:hover {
background: green;
}

This will result in the button having a blue background, until you have hovered over it with your mouse and change it to a green background.

So with that example, you can select an element like button add a pseudo-class that acts like condition hover that result in change in property like background

1 Like

Thank you for your comment. I will share the challenge, if you would not mind taking a quick look at it, attached forthwith is a screenshot of the challenge page I suppose might help us a little further, thank you so much :blush:!

Thank you for your comment. Here is a screenshot of this challenge. I really hope you would not mind taking a look at itโ€ฆ thank you :blush:

The not() pseudo-class are used following the element, to work as condition selecting the elements that arenโ€™t part of that condition.

While using :last-of-type pseudo-class following an element, to select the very last element.

Here are the docs for more details

Got it! Thank you so much for the help. It worked!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.