From the course: CSS for Programmers
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Declarative vs. imperative languages - CSS Tutorial
From the course: CSS for Programmers
Declarative vs. imperative languages
- [Instructor] CSS is a declarative coding language. Understanding the difference between a declarative language and an imperative language is key to understanding CSS. Most programming languages are imperative. They provide detailed step-by-step instructions to the computer about how it should perform a sequence of actions. Do this, then do this, then do this other thing exactly as I instruct it. Imperative languages give you full control and also give you ample opportunity to mess up. The computer will do exactly what you tell it to, and if your instructions lead to errors, the computer will execute them and cause those errors to take place. Declarative languages like HTML and CSS are different. They provide the computer with descriptions about what we want it to do, typically describing an end outcome, without providing step-by-step instructions on how to do it. So for example, using CSS, you can say, take this…