Introduction, types and comment

Quick Hands-on

See the Pen CSS Basics - Introduction, types and comment by (@) on CodePen.

Important Points to Remember

  • CSS stands for Cascading Style Sheets and describes how the web page should be displayed (look).

  • Describes how elements should be rendered on screen, paper, speech, or other media.

  • Three types or ways to add CSS to web page:
    • Inline CSS
    • Internal CSS
    • External CSS
  • Inline CSS: Used to apply a unique style for a single element.

  • Internal CSS: Include CSS rules for a single HTML page and has an effect on that page. It is defined in the <head> section using <style> element.

  • External CSS: The CSS rules are defined in a separate file with the extension .css. And, each HTML page must include a reference to the external style sheet file (.css) using the <link> element, inside the <head> section.

  • A comment is used to explain the code which might be helpful for self or for others. And, they are not displayed in the browser.