15 October 2020

What about CSS ?

A brief description of CSS, before suggesting a couple free courses.

CSS stands for cascading style sheets, and that's very much what they are — files that contains a set of rules to control the presentation of an HTML document (i.e. a web page/). The cascade part means that when rules conflict, those that are read later (i.e. lower in the file/) take precedence over those read earlier.

The primary responsibility of CSS is to separate presentation from content. The content and structure of a web page is determined by HTML being sent from the web server to the browser that you're using, while CSS controls how that content appears on the page.

For example, in that previous paragraph, the HTML looks something like this:

<p>
  The primary responsibility of CSS is to separate presentation from content.
  The structure and content of a web page is determined by HTML being sent from
  the web server to the browser that you're using, while CSS controls how that
  content <em>appears</em> on the page.
</p>

That doesn't tell the browser how to render the content, beyond the reasonable defaults it may have in place for paragraph (<p>) and emphasis (<em>) elements.

But when my web server sent your browser that bit of HTML, it also told it to include some CSS alongside it. And the CSS is what is responsible for determining presentation, like:

Since there are so many resources on CSS out there, that's where I'll stop this intro. If you want to dig in further on CSS, I'd suggest starting with a free course, like this one from Codeacademy or this video on HTML and CSS from freeCodeCamp.

Thanks for taking the time to read this!

If you enjoyed it, and think others would benefit from the read then feel free to share it on Twitter (or elsewhere). I’m always up for a discussion about anything I’ve written too, so get in touch if you want to chat!

If you’ve spotted something out of place or something needs correcting, feel free to let me know.

A newer entry Incrementing Variables in JavaScript

6 November 2020 JavaScript has three different types of incrementers: i++ ++i and i+=1. Let's look at how they differ from one another.

An older entry What is JavaScript ?

6 October 2020 A brief description of JavaScript, with links to dig in and learn more.