CSS- Cascading Style Sheets – PART I

Hello Readers.

I often face some problems when i use CSS like I forget tag names etc,. To overcome this i have brought some quick references for you.

First for newcomers we should begin with basics:

1. Selectors

* All elements
E All E elements
E, F All E and F elements
E F All F elements within Eelements
E > F All F elements with parent Eelements
E + F All F elements preceded by Eelements
.class All elements with class class
E.class All E elements with class class
#identifier Element with id identifier
E#identifier Element E with id identifier
E[attr] All E elements with attribute attr
E[attr=’value’] All E elements when attributeattr is equal to value
E[attr~=’value’] All E elements when attributeattr is a list containing value
E[attr|=’value’]  All E elements when attributeattr is a list beginning with value

2. Lengths and Percentage

UNIT DESCRIPTION
0 Zero (unit is optional)
em 1em = font size of parent
ex 1ex = height of an ‘x’
px Pixels
% Percentage
cm Centimeters
mm Millimeters
in Inches, 1in = 2.54cm
pt Points, 1pt = 1/72in
pc Picas, 1pc = 12pt
Advertisements

~ by sushantdebnath on September 21, 2011.

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

 
%d bloggers like this: