Please clarify code structure in CSS

<PLEASE USE THIS TEMPLATE TO HELP YOU CREATE A GREAT POST!>

Thanks for all the assistance as well as this site. I wanted to be clear as to why this code would not work: p { color: #00E5EE } div p { color: #CC0000 } * { border-color: #3A5FCD; border: 5px dotted black; }

YET this one did:

p {
color: #00E5EE
}
div p {
color: #CC0000
}

  • {
    border: 5px dotted black;
    border-color: #3A5FCD;
    }
    <Below this line, add a link to the EXACT exercise that you are stuck at.>

<Below this line, in what way does your code behave incorrectly? Include ALL error messages.>

Thank you in advance.



Replace this line with your code. 


Hi!

Please confirm your post. Both look alike.

Only thing I wish to point out is that, you are missing to end each statement with semi-colons in both instances.

Please, revert. Thank you!

Thank you, bayoishola20.

The semi-colons, while impotent, were not the issue. I already passed that section. What I wanted to know was why this particular structure did NOT work:

  • {
    border-color: #3A5FCD; border: 5px dotted black;
    }

However, when I checked the forum as I was stuck, I and to follow suite and this code DID work:

  • {
    border: 5px dotted black;
    border-color: #3A5FCD;
    }

Why the need to have to space it by hitting the Enter button? I did not read that in any of the lessons.

Thank you.

Okay! I now get your position.

This is my opinion: to pass the test, the code must have been scanned line-by-line and so, might not see that which you had placed in the same line.

EDIT: I guess the course intends to instill a convention and so might have not mentioned it somewhere or anywhere at that.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.