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

Domnick Knowlton
Domnick Knowlton
1,904 Points

Can you help with this code challenge?

Here is the link. I can't get it all, I spent maybe 30 minutes on it. So can someone please just give me the code to all 3 of them?

http://teamtreehouse.com/library/websites/css-foundations-2/selectors-reshoot/basic-attribute-selectors-2

3 Answers

This is the code that worked for me:

a[title] {
  color: darkred;
}

input[type="text"] {
  background: lightyellow;
}

input[type="submit"] {
  color: white;
  background: steelblue;
}

Attribute selectors can be quite tricky, took me a couple of tries to get this right. Check out this article for more info.

Hope this helps!

Ricky Catron
Ricky Catron
13,023 Points

@James Anwyl I understand where you are coming from. I love your suggestion of a hint or spoiler to prevent ruining challenges. That should definetly be implimented. @Domnick Knowlton I did not intend to be rude I am sorry it came accross that way. Also I had only looked at the first challenge so I apologize for not covering the subject you needed. Sorry your having a rough time but I promise it gets easier.

Domnick Knowlton
Domnick Knowlton
1,904 Points

Well, let me ask you this. Okay, here I am working on a code challenge, they word it wrong, but, I spend all my time rewording the code, and rewatching the video, then no other options I turn my back to the forums, you guys keep giving helpful hints, but I still do not get it, then what should I do to solve this problem?

Ricky Catron
Ricky Catron
13,023 Points

@Domnick Knowlton That I would completly understand and then I would give you the answer. If you posted earlier asking for hints I am sorry I didn't see it. All i saw was someone asking for an answer. My goal was to help you get there on your own. My answer was terrible because I didn't know what you didn't understand. A question like how do I connect my css to the anchor and input tags in these challenges would have helpped a lot. I'm sorry I misunderstood your question and your intent. I hope in the future I can give better answers.

Ricky Catron
Ricky Catron
13,023 Points

This is a place for help not answers. If we give you answers now we will need to do that for every challenge that involves this concept. What you should be asking is "How do I create an attribute selector that will target <a> elements with a title attribute and add a color property with the value darkred". To answer that you need to give the <a> element a class.

<a class="Whatever_I_want_to_name_my_class">

Then in the css select the class and give it a color value of darkred

.Whatever_I_want_to_name_my_class {
    color:darkred;
}

While I agree we shouldn't really give out answers, I think that sometimes the best way to figure something out is to work backwards from the answer. He mentioned he's already spent 30 minutes on it so is no doubt pretty frustrated by now, which is why I told him how I did it.

Would be nice to get some sort of spoiler revealer on the forums though so people who are searching for clues don't have the challenge ruined for them.

Just my 2 cents :)

Domnick Knowlton
Domnick Knowlton
1,904 Points

First of all, I needed help. Second of all, I did not need help with class / selectors and or ID's.