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

Basic Attribute Selectors

I'm having grave difficulty with the code challenge -

Add a new attribute selector that will target the input element with the type attribute value 'text'. Set the background color to 'lightyellow'. Its number 2 of 3 in the challenge.

If someone can please help I would be very grateful. I don't know how to insert screenshots in the forum either. If someone could help me with that I'll be able to get help a lot easier. Thanks

3 Answers

Hi Alan, I have learned you can get a lot of the information from the actual question.

For example: Target the input element, so that gives you your first bit, i.e.
input

input element with the type attribute value 'text' so its telling you, the type is text so that would be,

[type="text"]

so if you can put them all together and add your colour your done.

Thats exactly what I've done Wayne, must be a bug in there somewhere.

I've put input then the above, what you've kindly uploaded then my curly braces then of course the selector for background color. :(

> That's exactly what I've done Wayne, must be a bug in there somewhere.

I've just done the code challenge it's working correctly. Check out this thread on how to type code in the forum then post the code you are using and we will see if we can point you in the right direction.

Wrap your code with 3 backticks (```) on the line before and after. If you specify the language after the first set of backticks, that'll help with syntax highlighting.

        ```html
        <p>This is code!</p>
        ```

Alan,

if you paste your cove in the chat box, then add 4 spaces before each line of code it should appear just as my example.

input[type="text"] { background-color: red; }