When you find yourself writing certain styles repeatedly it's generally a red flag that you can refactor somewhere. In CSS this is most easily done by with classes. For example you use width:1200px and height:700px a couple of times. Creating a class with these styles and giving elements that require these styles requires less code. Plus when you start working on large applications it is much easier to find elements by class names and adding or removing them than multiple CSS selectors with the width or height properties and changing their values.
Don't repeat yourself
When you find yourself writing certain styles repeatedly it's generally a red flag that you can refactor somewhere. In CSS this is most easily done by with classes. For example you use
width:1200px
andheight:700px
a couple of times. Creating a class with these styles and giving elements that require these styles requires less code. Plus when you start working on large applications it is much easier to find elements by class names and adding or removing them than multiple CSS selectors with thewidth
orheight
properties and changing their values.You can read more about D.R.Y code here