Crilan / prj-rev-bwfs-dasmoto

0 stars 0 forks source link

Don't repeat your styles #3

Open zannain opened 6 years ago

zannain commented 6 years ago

Dont-Repeat-Yourself. This is a well known programming principle and if you find yourself repeating certain styles this is an indication that you may be able to simplify your stylesheet by making use of classes or using a more general selector. For example, instead of declaring font-weight: bold several times in the stylesheet a better option would be to create a class for it.

.bold {
    font-weight: bold;
}

This is in fact how libraries such as Bootstrap work under the hood!

Crilan commented 6 years ago

Thanks for this tip, i make the clase you reccomend and then give a class attribute to those html elements for that particular style.