HTML and CSS Reference
/* Positioning */
/* Box model */
/* Color */
/* Text */
/* Other */
Keep in mind that these are only guidelines; choose a structure that works for you
and aim to keep it consistent.
It is helpful to name classes and ids in a way that clarifies their intended use. This
structural naming convention means that the name should describe what the class or id
is used for instead of what it looks like or where it is used in the web document.
The advantage of this naming convention is that it becomes easier to change the
look of your web site. For example, naming an id container #main-content is better than
naming it #center-column-500px . In addition to intuitively understanding the use of the
id, the first name is more versatile in case you later need to adjust the position or size of
the element it is applied to.
margin: 0 auto; /* centered */
Names should be semantic, but not so semantic that they limit reuse. For instance,
naming a class .header-top-margin is not as flexible as naming the class .small-top-margin
(or .small-tm ). To later recall that the class is mainly used in the header is easy enough;