Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

stjarnan
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
stjarnan
Front End Web Development Techdegree Graduate 56,488 Points

W3C CSS Validator errors i don't know how to solve.

Hi there, i am trying to improve my CSS, and at the moment i am trying to style a form that is using HTML5 validation (putting "required" in the tags and stuff like that) to make sure that the user don't forget to write his or hers name or something. It works really good, but i like to validate my code to see if something is wrong, and then fix it (I have learned a lot this way!). I haven't been able to come up with a solution here though, and hopefully i can get some info from someone here on the Treehouse community!

This is the error shown when validating:

Unknown pseudo-element or pseudo-class :required Unknown pseudo-element or pseudo-class :invalid Unknown pseudo-element or pseudo-class :valid

I am using them like this:

input:required {
    border: solid 1px black;
}

input:invalid {
  border: solid 1px red;
}

input:valid {
    border: solid 1px green;
}

Thanks in advance!

1 Answer

Dane Parchment
MOD
Dane Parchment
Treehouse Moderator 11,076 Points

The required and valid pseudo elements are not part of the css standard specification yet I believe, and as such the validator doesn't know that it exists. You can still use it, and it will do its job, but it just hasn't been added to documentation and the like as of now!