Introduction:

  • CSS stands for Cascading Style Sheets.
  • It is a text file to store properties.
  • Mainly used to apply styles to web pages.
  • It controls the presentation of HTML document.
  • Presentation includes colors,layout and fonts.
  • We can use same css sheet to multiple HTML pages.
  • Css changes applied globally to web page.
CSS Syntax: The style set rule consists of selector and declaration block.
Selector => h1
Declaration => { color: red; font-size: 14px; }
  • The selector points to HTML element that we want to style.
  • The declaration block have one or more declarations separated by semicolons.
  • Each declaration includes a css property name and a value, separated by colon.
  • Here color is property and red is value.
  • Declarations blocks are surrounded by curly braces.
CSS Comments:
  • Comments are used to explain the source code.
  • Css comment starts with /* and ends with */.