Posts

Showing posts with the label Type of css selectors

Type of CSS Selectors

Image
  Types of CSS selectors  Type   1. Universal Selector    2. ID Selector   3. Tag Selector 4. Class Selector    5. Attribute Selector 1. Universal Selector   The universal selector, written as is star symbol matches every single element the page. It is used for selecting all elements on a page. The universal selector omitted if other conditions exist on the target element. This selector is often use to remove the default margins and padding from the element for quick testing purpose. Syntax: *{ style properties } Universal Selector  Example   <!DOCTYPE html>  <html>  <head>  <style> *{  color: green;  font-size: 20px; } </style> </head>  <body>  <h2> Universal Selector</h2>  <p> This style is the applied on every paragraph.</p>   <p id="para1">Second Paragraph</p>  <p>and Third Paragraph</p...