CSS Shorthand Properties

July 7, 2008 at 5:56 pm Leave a comment

If you are working on CSS then may or may not be you using CSS shorthand properties, if you are not using then start using becuase it’s give a less code to your stylesheet and deifnately you learning new way to write CSS 🙂

FONT

start using:

.fontSample{font: normal italic 1em/1.2em Arial, Helvetica, sans-serif;}

instead of:

.fontSample{
font-weight: normal;
font-style: italic;
font-size: 1em;
line-height: 1.2em;
font-family: Arial, Helvetica, sans-serif;
}

BACKGROUND

start using:

.backgroundSample{background: #CCCCCC url(logo.png) left top no-repeat fixed;}

insted of:

.backgroundSample{
background-color: #CCCCCC;
background-image: url(logo.png);
background-position: left top;
background-repeat: no-repeat;
background-attachment: fixed;}

MARGIN & PADDING

Start Using:

.marginSample{margin: 0 10px 20px 10px;}

Instead of:

.marginSample{
margin-top: 0;
margin-right: 10px;
margin-bottom: 20px;
margin-left: 10px;
}

It’s work margin (top, right, bottom, left)

Same for padding  others too will discuss in couple of days start using these 🙂

Advertisements

Entry filed under: CSS & JavaScript.

Styling INPUT using CSS and JavaScript Javascript Libraries

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


Tweets… :)

Categories

Feeds

Blog Stats

  • 20,672 hits

%d bloggers like this: