CSS Tutorial

CSS stands for Cascading Styles Sheets. CSS define how HTML is displayed, whereas the HTML itself defines the content of a document. It was introduced in HTML 4.0 as a way to separate the document content from the document presentation.

CSS styles the look and feel of the content displayed on a web page. The following can controlled using CSS:

  • the text color
  • the font type and style
  • the paragraphs spacing
  • columns sizes and layout
  • background images or colors
  • layout designs
  • responsiveness across different devices
  • animations
  • etc

Advantages of CSS

  • styling can be reused – one the biggest advantages of using CSS to style webpages is that you can write CSS once and then use the same stylesheet to style multiple HTML pages. This kind of reusability allows the same CSS to be used throughout the whole website and delivery a uniform look across all pages.
  • faster page loading – styling a page using CSS instead of tag attributes allows us to write one CSS rule of a tag and apply it to all the occurrences of that tag. This produces a smaller code that loads faster.
  • easy to maintain – to change the styling of an element simply edit the CSS rule for that element in the stylesheet and every occurrence of that element will be updated. This is better than going through the webpages manually editing the element styles.
  • superior styles – CSS was created specifically for styling which means that it has a much wider range of a styling attributes than HTML.