Question:

What is CSS?

CSS stands for Cascading Style Sheets. It’s the language you use to make websites look good. HTML provides the structure and content, and CSS provides the design and layout.

Without CSS, every website would look like a plain text document. CSS lets you add colors, change fonts, adjust spacing, create layouts, add animations, and control how everything appears on different screen sizes. When you visit a beautifully designed website, CSS is doing most of the visual work.

Here’s a simple example. Say you have some HTML:

<h1>Welcome to my site</h1>
<p>This is a paragraph.</p>

You can style it with CSS:

h1 {
  color: blue;
  font-size: 32px;
}

p {
  color: gray;
  line-height: 1.6;
}

The “cascading” part means styles can inherit and override each other. If you set a font on the body element, all the text inside inherits that font unless you specifically override it. This makes it easier to maintain consistent styling across your site.

CSS started in 1996 to solve a real problem. Before CSS, styling was mixed directly into HTML with tags like <font> and attributes like bgcolor. This made websites hard to maintain and update. CSS separated the styling from the content, so you could change the design of an entire site by editing one CSS file.

Modern CSS is incredibly powerful. You can create complex layouts with Flexbox and Grid, build responsive designs that work on any screen size, add smooth animations and transitions, and even create variables to reuse values across your styles. Frameworks like Bootstrap and Tailwind build on top of CSS to make styling even faster.

Every front-end developer needs to know CSS well. It’s one of the three core web technologies along with HTML and JavaScript. You’ll use CSS whether you’re building a simple landing page or a complex web application.

I’ve been writing CSS for over 20 years. When I started, we were still dealing with browser incompatibilities and hacks to make layouts work. Modern CSS is so much better. Features like Flexbox and Grid make layouts trivial compared to the float-based hacks we used to do. CSS has come a long way.

You might also like