Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
These are the instructions:


Open the styles.css file.

Add a CSS rule for the body element that sets the background color to #E0E0E2.

Add a CSS rule for the h1 element that sets the text color to: #721817.

Add a CSS rule for the h2 element that sets the text color to: #721817.

Add a CSS rule for the center-text CSS class that aligns the text to center.

Add a CSS rule for the HTML element with the id logo. Set its left and right margins to auto and changes its display to a block element.

Add a CSS rule for all span elements that are children of h2 elements that sets the text color to #FA9F42 and its font size to 0.75em.

Add a CSS rule for the HTML element with the id copyright. Set its top padding to 12 pixels and its font size to 0.75em

CSS
body{
    background-color:#E0E0E2;
}
h1{
    color: #721817;
}
h2{
    color: #721817;
}
.center-text{
text-align: center;
}
#logo{
    margin-left: auto;
    margin-right: auto;
    display: block;
}
#span {
    color: #FA9F42;
    font-size: 0.75em;
}
#copyright {
    padding-top: 12px;
    font-size: 0.75em;
}


The errors that come up are the following:
xxThe 'NEW' labels within <h2> tags should have a color of '#fa9f42' 
xxThe element with the ID 'copyright' should have a font-size of 0.75em


What I have tried:

I have tried re-entering the color and also re-typing the font-size that's being asked.
Posted
Updated 16-Jul-23 18:16pm
v2

The errors are telling you exactly what is wrong. Look in your CSS and find the h2 element descriptor, then look in its properties and you'll you didn't set the value to what is expected.

The exact same thing is true for "copyright".

This is your homework assignment, so I'm not going to correct this for you. You would learn nothing if I did.
 
Share this answer
 
Comments
Member 15769220 16-Sep-22 2:33am    
bro then whyd you even comment if youre not going to help, seems to me you have no clue what youre doing and you dont know the answer
Dave Kreskowiak 16-Sep-22 12:45pm    
I told you exactly what to look at. That IS helping you. It's helping you to debug your own code.

If that isn't helping, then what is? Coming over to your house and typing it in for you? That's not going to happen.
Warning: I'm absolute beginner with CSS, but after some readings I would say the selector for span tags inside h2 tags is h2 > span. And therefore the rule 'Add a CSS rule for all span elements that are children of h2 elements that sets the text color to #FA9F42 and its font size to 0.75em.' will be:
h2 > span {color: #FA9F42; font-size: 0.75em;}


Keep in mind that does not select nested span tags.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900