Why is this code not working?
margin: 10 auto;
background: rgba(42, 42, 119, 1);
<div class="A"> </div>
<div class="B"> </div>
Challenge: Create a Gradual CSS Linear Gradient
Link to the challenge:
According to the original code for this challenge, you added too much things. You need to add only what is asked in the exercice. Here, you only need to add a
background property for the
If you are testing things with this CSS code, you can share with us the HTML code you did too.
the code is correct but assignment is:
Use a `linear-gradient()` for the `div` element’s `background`.
Actually I was testing some of the codes in VS to better understand the underlying concepts. But this one code didn’t work, only header tag worked.
I tested your code and I think the reason why you don’t see appear your backgrounds it is because you added a comma before the closing parenthesis for the
repeating-linear-gradient methods used in your two selectors
background: repeating-linear-gradient( 90deg, yellow 5px, black 40px, green 40px, red 80px, );
Remove these commas and it should be ok. Tell us if it is the result you were expecting.
I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (
</>) to add backticks around text.
See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).
Thank you so much @LucLH , now that the "div"s showed up I can explore more about colors and relative & absolute positioning.
You’re welcome @Sina.tr. Have a good exploration in the CSS world
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.