1.

CSS

Answer»

Types of SELECTORS:

  • TYPE Selector (ELEMENT Selector): selects all the elements which match the given type. 

Example: h1 [Selects all the elements with h1 tag.]

  • ID Selector: selects the element which matches the ID VALUE. It’s suggested that there should be only one element for a given ID.

Example: #first-name [Selects the element having first-name as an ID value.] 

  • Class Selector: selects all the elements which match the given class name.

Example: .blue [selects all the elements with a class name blue.] 

  • Universal Selector: selects all the elements in the document.

Example: * [Selects all the elements in the document.]

  • Attribute Selector: selects the element which matches the attribute value.

Example: a [target = “_blank”] selects all the anchor elements with attribute value is _blank.



Discussion

No Comment Found