Articles Tutorials Work at Home Entrepreneurs, Webmasters, Small Business Owners
Articles Tutorials Work at Home Entrepreneurs, Webmasters, Small Business Owners
Articles & Tutorials for Work at Home Entrepreneurs
Webmasters and Small Business Owners
Get More >

Newest Articles 
Search Engine Marketing
Internet Marketing
Affiliate Marketing
Email Marketing
Viral Marketing
Webmaster Resources
Business Resources
Make More Money
CSS
Web Design
Graphic Design
Color Theory
Product Reviews
Time Management
Business Ethics
Promotional Strategies
Glossary of Terms
Direct Mail Marketing
Telemarketing
Product Sourcing



Link to Us!

CSS
Email this article  :  Printer friendly page

CSS Shorthand, Part 1: Padding & Margins

After you have learned the basic CSS rules, you will be amazed at the extensive potential cascading style sheets offers. I would highly recommend reading through most of our CSS tutorials so you can understand the basic concept prior to jumping into this week's style sheet article. It will certainly make more sense to you especially if you are new to this web programming language.

Most of our tutorials refer to the External CSS method, because that is what we use in the development of our web templates and is the most logical way to design a functional web site interface for the end user (our customers and members). You may want to familiarize yourself with why "external" style sheets are the most effective way to design a web site (rather than internal or inline), by first reading our article, "External, Internal or Inline? Which Method is Best?".

This article is the first in our series of "CSS Shorthand" which we are publishing. This tutorial focuses on the padding and margin shorthand technique. Sample code for the full and shorthand methods are shown below for comparison purposes.

Important: It is very important that you think of the progressive flow of the shorthand properties as being clockwise: top, right, bottom, left.

Padding
Margins

Full method:
.yourclassname {
padding-top: 5px;
padding-right: 10px;
padding-bottom: 5px;
padding-left: 10px;
}

Shorthand method:
.yourclassname {
padding: 5px 10px 5px 10px;
}

Full method:
.yourclassname {
margin-top: 15px;
margin-right: 30px;
margin-bottom: 18px;
margin-left: 33px;
}

Shorthand method:
.yourclassname {
margin: 15px 30px 18px 33px;
}

Related Article: "CSS Shorthand, Part 2: Borders"

Copyright © 1994-2006 by BasicTips.com, a division of BasicTemplates.com, CSS HTML Web Site Templates with Exernal CSS and Removable Graphics. If you found our articles helpful, subscribe to our newsletter and get articles like this delivered to your inbox - FREE.

Order soon and get up to 5 FREE domains & more!
Host 6 Domains on 1 Account
5000MB and 400GB for $6.95 a month!

 

Page copy protected against web site content infringement by Copyscape
All articles are originally authored by BasicTemplates.com. Reprints in whole or in part are not permitted. See Copyright Notice

Copyright © 1994-2006 BasicTips.com, a division of BasicTemplates.com, Web Site Templates with External CSS
The Internet's #1 Choice for HTML CSS Web Templates via a Membership. Designed using External CSS and Removable, Swap-Out Graphics.
Basic Web Templates | Website Templates | HTML CSS Templates | Web Design Templates | Web Site Templates