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 CSS Foundations Selectors Basic Attribute Selectors

Ryan Decker
Ryan Decker
3,451 Points

Finally, add a new attribute selector that will target the submit button. Set the text color to white and the backgroud

What is wrong with the CSS I am using in this section of the challenge????

index.html
<!DOCTYPE html>
<html>
<head>
    <title>Attribute Selectors</title>
    <link rel="stylesheet" href="page.css">
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <p>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus sed egestas tortor, vel tincidunt dolor.
    </p>
    <a href="#" title="More!">Duis ut velit faucibus</a>
    <p>
        Proin orci arcu, dapibus vel faucibus in, commodo in nunc. <a href="#">Vestibulum erat dolor laoreet</a> nec cursus non, luctus ut elit. In sed congue lectus, id ullamcorper massa. <a href="#" title="More!">View more &raquo;</a>
    </p>
    <form>
        <input type="text" name="email">
        <input type="submit" name="submit">
    </form>
</body>
</html>
style.css
/* Complete the challenge by writing CSS below */

a , title {color: darkred;}

input , text {background-color: lightyellow;}

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

4 Answers

try

input [type="submit"] { color: white; background: (whatever it says it should be) }

i hope this helps!

Kind regards //Erdrag.

Edward Bryan Kene Morales
Edward Bryan Kene Morales
7,374 Points

Hi again Ryan,

I replied to your query earlier. There's a syntax error in your code. Your code should be written like this:

a[title] {color: darkred;}

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

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

If we are to interpret them one by one, here's how it would sound like:

a , title {color: darkred;}

In this selector, what it does is target anchor links and title tags and set their color to darkred. By this alone we can say that there is something wrong because title tags are attributes not HTML tags so it should be written like this:

a[title] {color: darkred;}

This targets the anchor tag that has a title attribute. The same case with your second selector:

input , text {background-color: lightyellow;}

You are targeting input and text HTML tags. The seconds again is not a valid HTML tag. So I guess it should go like this:

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

This way you are targeting input elements that has a type attribute value of text. Your third code is super close!

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

All you need to do is get rid of the space in between the input and the first bracket:

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

I hope this solves your issue :)

Ryan Decker
Ryan Decker
3,451 Points

It isn't accepting the code as correct. :(

/* Complete the challenge by writing CSS below */ a[title="More!"] { color: darkred; }

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

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