Intimidated By CSS? The Definitive Guide To Make Your Fear Disappear

Disclosure: Your support helps keep the site running! We earn a referral fee for some of the services we recommend on this page. Learn more

Sharing is caring!

Last Updated on

CSS is the language that defines the presentation of a web page. It is used to add color, background images, and textures, and to arrange elements on the page. However, CSS does a lot more than just paint a pretty picture. It is also used to enhance the usability of a website. The image below shows the front page of YouTube. On the left, is a regular rendering of the page, and on the right you can see how it looks without CSS.

A comparison of how YouTube looks with and without CSS rules

Not only is the image on the right less interesting, but it is also a lot harder to use.

In this short guide, we’ll introduce CSS, demonstrate CSS syntax, explain how CSS works, show you how to add CSS markup to an HTML document, and point you toward great resources from around the web where you can learn more about CSS.

  • 3 Preparing HTML Markup for Styling
  • 3.1 When to Use Classes
  • 3.2 When to Use IDs
  • 3.3 When Not to Use Hooks
  • 3.4 Best Practices for Preparing Your Markup for Styling
  • 4 Ways of Linking CSS Rules to an HTML Document
  • 4.1 Inline Styles
  • 4.2 Internal Stylesheets
  • 4.3 External Stylesheets
  • 4.4 When to Use Each Method
  • 5 How CSS Works
  • 5.1 Cascading Inheritance
  • 5.2 Specificity