I read this (this is a post from css-tricks.com) and this (this is a comment on the post).
This is what my css looks like:
.m0 { margin : 0%; } //m0 = Margin 0% <br> .mla { margin-left : auto; } //mla = Margin Left Auto <br> .mra { margin-right : auto; } //mra = Margin Right Auto .w100px { width : 1000px; } //w1000px = Width 1000px .h100 { height : 100%; } //h100 = Height 100%
etc..
I use my css only with classes, for example:
<html class="h100"> , <body class="m0 h100"> , <div class="mla mra w1000px">
etc...
If I want to create a red page using only the body, my classes will look like this:
CSS
.m0 { margin : 0%; } .bc08070 { background-color : hsl(0, 80%, 70%); }
HTML
<body class="m0 bc08070">
I write class names in the order in which I wrote css to: Margin (first), Width (next), Height (after that), Background Color (after that).
This way, I do not rewrite the code, and if I need to add the css attribute, I can just add the appropriate class, I feel that I have much better control.
Is this the best deal in css in terms of efficiency?
If this is not the case, please delve deeper into a better agreement so that I understand which agreement I use, and more importantly, why I use it.