Are you a beginner in CSS? Some useful tips for you

1. Diffrence between Class and ID’s

Both are use for describe content and layout in a web page. Symbol for class selectors is (.) while id selectors is (#).

Class: We can use the same class on multiple elements and also multiple class on same element.

ID’s: Id’s are unique. It can only be used once in a page. The main advantages of ids are that they get priority in the cascade.

2. Use Reset.css

By default, browsers have different ways of rendering styles. Reset.CSS, basically reset the default values of web browsers and you won’t need to alter these differences for every element again.

Some example are

Yahoo Reset CSS

Eric Meyer’s CSS Reset

Tripoli Reset.CSS

3. Use Shorthand CSS

Shorthand CSS gives you a shorter way of writing your CSS codes.

Read my last post. click here

4. Align Center any block element

You can align any block element in to center by using

margin:0 auto;

In any HTML document it will be given an automatic margin on both its left and right, ensuring that it’s always placed in the center of the screen.

5. Css Positioning

The CSS positioning properties allows you to position an element. It allow you to specify the left, right, top, and bottom position of an element. It have same properties like:






You can read Much  about positioning here

Css Positioning

6. Use clean code

If your css code is messy then it is very confusing and time taken to manage. Use clean code by using shorthand technique and using some tips and also u can use online code cleaner.

7. Use tables for tabular data not div

If you want to place information like data in Spreadsheet then it is tabular by nature and, therefore, should be displayed in an HTML table.

You can find more details about that: click here

Joginder Poswal

Tags: ,

This entry was posted on Tuesday, May 5th, 2009 at 1:58 am and is filed under CSS. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

One Response to “Are you a beginner in CSS? Some useful tips for you”

  1. vikash Says:

    i am a beginner in CSS.plz post some more tech. about css for beginners.

Leave a Reply

This blog is kept spam free by WP-SpamFree.


Get Adobe Flash player