Explain the css part


#1

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

<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.>

opacity property is not getting reflected in my webpage ,
but when i separate the opacity as listed below opacity property is getting reflected
please explain it.



.first{border:1px,opacity:0.5;}

.first{border:1px;}
.first{opacity:0.5;}



#2

The comma is the problem. Change that to semi-colon.

Something that helps us prevent these sort of errors is whitespace. Use lots of it, and only write one property per line. That way it is easy to see if any semi-colons are missing (or commas used by mistake).

.first{
    border: 1px;
    opacity: 0.5;
}

There is nothing gained by trying to squeeze code into a small chunk. It hides too many small errors.


#3

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