CSS Selector's


Syntax of CSS
CSS Syntax and it's calling?
A CSS rule set contains a selector and a declaration block.We can define CSS 2 types:-
·        CSS define through ID
·        CSS define through Class
·        Each declaration includes a CSS property name and a value, separated by colon.
ID selector
The id selector uses the id attribute of an HTML element to select a specific element.
The id of an element should be unique with in a page, so the id selector is used to select one unique element.
ID defines with "#".
Example :-   #a{
                                    background-color:yellow;
                                    font-size:24px;
                           }
                                                Class selector
A Class selector elements with a specific class attributes. The select elements with a specific class, write a period(.) character, followed by the name of the class.
Class defines with ".".

Example :-   .a{
                                    background-color:yellow;
                                    font-size:24px;
                           }


Comments

Popular Posts