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

I can't get the disabled or checked pseudo classes to work and I can't see what I'm doing wrong.

I can't get the email field to be disabled or the CSS code for the check boxes to work. I'm not sure what I'm doing wrong. Is there something I am missing or doing wrong?

The code to disable the email box is below: <input type="email" id="email" placeholder="email@website.com" disabled>

The style.css file I have written is below:

input:focus, textarea:focus { border-color: #52bab3; }

input:disabled { background: #ddd; }

input[type="checkbox":checked + label {

font-weight:bold;

}

input:focus, 
textarea:focus {
border-color: #52bab3;
 }

input:disabled {
 background: #ddd;
 }

input[type="checkbox"]:checked + label {  //missing brace ]
font-weight:bold;
}

only mistake i caught

1 Answer

Billy Bellchambers
Billy Bellchambers
21,689 Points

Hi Robert,

You need to set the input as disable in your HTML for pseudo class to take affect.

Example.

<input type="submit" value="Submit" disabled> 

as for the input i believe it should read.

input[type="checkbox"]:checked  { //needs closing ] and not sure where the ""+ label"" came come?

font-weight:bold;

}

if that doesn't help try forking your workspace or including all code so we can see the issue.

Think that should solve the issue