Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Right / Best way to write CSS?

Does the structure of CSS has any impact on the performance of the site?

Scenario 1)

.class1 {position:absolute; top:0; right:13%}

.class2 {position:absolute; top:0; right:17%}

.class3 {position:absolute; top:0; right:29%}

Scenario 2)

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

.class1, .class2, .class3 {position:absolute; top:0}

.class1 {right:13%}
.class2 {right:17%}
.class3 {right:29%}

My guess would be that 1) is better in terms of performance ?
I know that 1) is easier to maintain but what about performance?

Also, what is the best way to write CSS / some tricks to improve site performance by optimizing CSS?

>Solution :

I think it’s just less code = better performance
but not by much unless you are working on thousands of lines of code
I would just keep my code as easy to read as possible and delete anything unnecessary.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading