Jump to content

Ordering CSS declarations in a declaration block


_david_aaron
 Share

Recommended Posts

  • 3 weeks later...

A property and value pair is called declaration.

Both property and value is case-insensitive by default in CSS.

The pair is separated by colon " : ".

Whenever you put declaration in open and close braces it's called declaration block.

And declaration inside them is separated by semi-colon.

ex:

*{

color : red;

margin : 10px;

}

I think there is no such type of guidance for declaration block.

But you should write declaration block first for the whole element (*), after that for body element (body), and last is for every class or id selector.

I hope this'll help you.

Thanks!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...