What is CSS?

Ever wonder how web pages have a specific look and feel with color, fonts, and layout? These features are part of the Cascading Stylesheet (CSS) language. It provides for the separation of the data in HTML from the styling of the data. Thus, developers can define the look of a webpage separately from the text it contains.

There are three ways to write CSS:

  • Inline CSS: HTML element is styled;
  • Embedded CSS: CSS rules are located in an HTML file; and
  • External CSS: CSS is located in an external file. This makes the CSS code easy to maintain and reusable.

We'll look at each type in the following sections.

Browser Defaults


However, the web would be a boring place if all websites looked like that. Using CSS you can control exactly how HTML elements look in the browser, presenting your markup using whatever design you like.

For more on browser/default styles, check out the following video: