D
D
Dmitry Khaperets2014-07-22 05:27:06
css
Dmitry Khaperets, 2014-07-22 05:27:06

How to write CSS code in a good style?

Hello!
I want to write CSS code in a single style on projects (property order, indents, class names or identifiers, etc.). If there are any standards - throw off, please, a link to the information.
It is desirable that the information about the rules for writing code be complete.
PHP example: PSR standards

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
Ivan Belenkov, 2014-07-22
@Khaperets

As such, there are no standards. As a rule, in each organization in which you will work, there is a style guide for all known technologies. If you're working solo, then try one of the class naming patterns. For example, google OOCSS , MCSS or BEM .
Sticking to a certain property order when writing CSS is tricky. Here it is much easier to use the post-processing of the CSS file. For example, the @MonkAlbino user mentioned here, CSScomb , or another more advanced solution. You can also use other people's style guides if they are freely available. For example, Google HTML/CSS Style Guide .

M
Michael Danilov, 2014-07-22
@MonkAlbino

csscomb

O
Oleg Krasnov, 2014-07-22
@OKrasnov

CSS specification

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question