Details of CSS

CSS Selectors

CSS selectors define the elements to which a set of CSS rules apply.

  • Universal selector:- Selects all elements. Optionally, it may be restricted to a specific namespace or to all namespaces.
  • Type selector:- Selects all elements that have the given node name.
  • Class selector:- Selects all elements that have the given class attribute.
  • ID selector:- Selects an element based on the value of its id attribute. There should be only one element with a given ID in a document.
  • Attribute selector:- Selects all elements that have the given attribute.
  • CSS Property Name

    CSS property name selects the property of the element to be changed.

    Some examples:-

  • align-content :- Specifies the alignment between the lines inside a flexible container when the items do not use all available space
  • align-items :- Specifies the alignment for items inside a flexible container
  • align-self :- Specifies the alignment for selected items inside a flexible container
  • all :- Resets all properties (except unicode-bidi and direction)
  • CSS Property value

    CSS property value is given to the property following a colon (NOT an “equals” sign). Semi-colons are used to separate the properties.

    Home