_david_aaron Posted May 31, 2020 Share Posted May 31, 2020 W3Schools seems to be pretty consistent in the way declarations are ordered in a declaration block. What is this based off of? Do they have a style guide for this? What are recommended practices for ordering declarations? Thanks! Link to comment Share on other sites More sharing options...
shaili_shah Posted June 19, 2020 Share Posted June 19, 2020 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now