Tell us what’s happening:
Describe your issue in detail here.
**Your code so far**
<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
font-family: Lobster, monospace;
<p class="red-text">Click here to view more in <a href="#">cat photos</a>.</p>
<a href="#"><img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back."></a>
<p>Things cats love:</p>
<p>Top 3 things cats hate:</p>
<form action="https://freecatphotoapp.com/submit-cat-photo" id= #cat-photo-form background-color:green;}>
<label><input type="radio" name="indoor-outdoor" checked> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label><br>
<label><input type="checkbox" name="personality" checked> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Energetic</label><br>
<input type="text" placeholder="cat photo URL" required>
The assignment is to give the form a green background. Please, I need hints on how to go about it.
Challenge: Use an id Attribute to Style an Element
Link to the challenge:
This is an example of how you set CSS properties for the HTML elements using their id
You need to do the same for the HTML element with the id of
cat-photo-form in this lesson. Give it a green background.
This is what I did to the HTML element:
Where did I go wrong, please?
For this challenge, you want to apply your styles within the
<style> tag, not in the HTML element itself, (although it is still possible by using the style attribute).
You refer to the id of an element in CSS with
Here just insert a
# and write the id of that element right after it. Similar to this:
You mean like this:
Please, how can I use the style attribute in the HTML element?
I still need help, please. I’m still stuck in this assignment.
This is how you give an HTML element an id.
<p id="someSelectorName">Some paragraph text</p>
This is how you use that same id in the CSS as a selector.
/* CSS properties and values goes here */
The form element has this id
id="cat-photo-form" so how do you think you should write the selector in the CSS?
Please, I’m still stuck in this assignment.
This is how I added the id attribute to the CSS style tag:
This is what my HTML tag looks like:
<form action="https://freecatphotoapp.com/submit-cat-photo" id="cat-photo-form">
The assignment is to give a green background to to my HTML form. I have given the id attribute, how can I give the green background, please?
The name of the ID in your HTML element just needs to match the ID selector (#) in your CSS style tag.
At the moment your #cat-photo-element is looking for an HTML element with the id=“cat-photo-element”.
Hope that makes sense
I have done that, and it comes back wrong, and I changed it back to ‘form’
You need to pay close attention.
This is the id you have on the element:
This is the selector you have written:
They do not match.
It keeps saying '‘your form element should have the background-color of green’.
Thank you. I just realized my error. I appreciate
Thank you. I have seen my error. I appreciate your help.
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.