Thursday, March 22, 2012

ID & Class

For setting the HTML style CSS is provide "id"  &  "class" to define your styles in SELECTOR section .


The ID 


1. The id is used to specify a style for a unique element.

2. The id uses the id attribute of the HTML element, and is defined with a "#".

example:-

#style
{
text-align:center;
color:red;
} 



The class Selector

Class is used to specify a style for group of element

1. This is used to style for many HTML element with the same class.

2. The class selector is defined as ".".

example :


p.center {text-align:center;} 



Friday, March 16, 2012

The CSS rule has two main part that is SELECTOR and the second is DECLARATION.

p {color:red;text-align:center;} 

in this code 
  • P is Selector 
  • color & text is declaration

.



Starting with CSS

The CSS is stands for "Cascading Style Sheet ".
Styles are normally saved in external .css files. External style sheets enable you to change the appearance and layout of all the pages in a Web site, just by editing one single file!