The Power Of CSS Shorthand
So many web developers specially those who are new to the whole HTML CSS thing, will normally write out every single line of code exactly as they were taught.
There is nothing wrong with this type of coding, the only problem is that it takes up a lot of extra time, and from my experience, clients are not interested in what will take the longest, clients want things to happen snappy.
If you've been in coding for quite some time or just starting out, these examples that I'll be giving you will definitely help to code faster and smarter. It can make such a big difference, for example, a css file that contains 1000 lines of code, can become a 500 line css file simply by using shorthand css procedures.
1. Background Attribute - CSS Tag
background-image: url(images);
background-position: 10px 50px;
background-repeat: no-repeat;
background: #fff url(image) 10px 50px no-repeat;
2. Margin & Padding Attribute - CSS Tag
replace the margin for when using padding
margin: top right bottom left; "For individual margins"
3. Border Attribute - CSS Tag
4. Font Attribute - CSS Tag
font-family: Verdana, Arial;
font: italic bold 15px/1.5 Verdana, Arial;
5. Color Attribute - CSS Tag
Dark Grey: #666666 to #666
Light Grey: #cccccc to #ccc