freeCodeCamp Challenge Guide: Use an ID Attribute to Style an Element

freeCodeCamp Challenge Guide: Use an ID Attribute to Style an Element
0

#1

One cool thing about id attributes is that, like classes, you can style them using CSS.

Here’s an example of how you can take your element with the id attribute of cat-photo-element and give it the background color of green.

In your style element: #cat-photo-element { background-color: green; }

Note that inside your style element, you always reference classes by putting a . in front of their names. You always reference ids by putting a # in front of their names.


#2

I need help please! Can’t seem to figure this out. there’s no help at all. Thanks much!


#3
#cat-photo-form { background-color:green; }

and in form input the id


#5

Thanks Assad. Finally. Just spent 6 hours on this, doh!


#6

I feel like I’ve tried everything and can’t get pass this. Help?


#7

@spongebob77737
it says btw ur style element execute
#cat-photo-form
{
background-color: green;
}


#8

Can some one give us the solution


#9

i did it weeeeeeeeeeey


#12

unsure if #cat-photo-element {background-color: green;} should be in or not.


#13

CAN SOMEONE PLEASE EXPLAIN WHAT IT IS THAT IM MISSING WITH THE CODE? THANK YOU


#14


#15

IT’s always the highlighted part, check your spacing
} #cat-photo-form {background-color: green}
I left the previous bracket on there for reference


#16

how do you input the id in the form element…cant seem to get around this.someone help pls


#17

#cat-photo-form {
background-color: green;
}


#18

#cat-photo-form
{
background-color: green
}
this should be use in style
and id must use in form


#19

when you say input the id in the form, how does that look? I have it the style element but can’t seem to get it right in the form to trigger the green background
Thanks


#21

Hope this will help


#22

reset it a ft a few times but didn’t notice that I left out the # in the style element TY


#23

it should work at this way. typing in the style section as form {background-color:green;}
hope will help


#24