Is CSS the main language used to style webpages?

Question

Is CSS the main language used to style webpages?

Answer

Yes! CSS is the main language used to style webpages - we can style anything from fonts, colors, and layouts to transitions and animations.

2 Likes

follow up question, are there any others? And if so is there ever a real reason to use one of them instead of CSS?

Before CSS you had to style your page in your HTML.

<h1><font color="red"> Chapter 1. </font></h1>

Notice how this is different from inline CSS

<h1 style="color: red;"> Chapter 1. </h1>

To my knowledge there are no real alternatives to CSS, besides from some frameworks that were based on javascript, such as LESS. But they have to be transpiled into CSS before presenting it to the browser.

So basically CSS is the only way to go. In our current world, websites are based on HTML and are styled using CSS.

6 Likes

We can also use JavaScript for styling webpages but CSS is most commonly used.

True but Javascript falls back to CSS to do the actual styling :wink: . You can’t live without CSS today…

3 Likes

You can use SASS (Syntactically Awesome Style Sheets) instead of directly using CSS:
https://sass-lang.com/