Jump to content

Ordering CSS declarations in a declaration block

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.



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.


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...