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

Christer Nordbø
Christer Nordbø
2,133 Points

[issue] Advanced Selectors -> More Pseudo-classes

Im having a struggle with the Codechallenge on this video.

Task:

The 'Phone' field in this form has been disabled in the HTML file. Create a new rule that selects the disabled field only, then set its background color to lightgray.

In the video you are using

:disabled { ...... } 

To select the disabled field. But when i try to do this is the Codechallenge it doesnt work.

my code:

:disabled {
  background-color: lightgray;
}

Whats the problem with this code?

[Solved] Removed the space after the :disabled and the { and it worked. I believe you should check some of the codechallenges for these "errors" as its not wrong code to have a space between a selector and the open curly bracked. specially since its allowed in most of the tasks.

1 Answer

James Barnett
James Barnett
39,199 Points

This code worked fine for me ...

:disabled {
  background-color: lightgray;
}

You probably made a typo and corrected it without realizing it.