Cascading Style Sheets (CSS) is a language used to add style to web pages.
CSS is categorized as a style sheet language, a language that renders the displays of structured documents. In the case of CSS, our structured document is the HTML markup we want to style. Some other examples of style sheet languages include:
- DSSSL: Document Style Semantics and Specification Language
- XSL: Extensible Stylesheet Language
CSS gives us a place for all our style-related code. This way, our HTML can continue to do its job of defining the document’s structure instead of how the web page should look in the browser. This is known as the separation of concerns. The idea is that HTML should only contain information about the content structure, and all styling decisions should be made directly in CSS.
CSS is constantly evolving, thanks to an incredibly passionate community of developers. It’s remarkable to see what we’re now able to achieve with CSS compared to just a few years ago.
The basics of CSS are relatively straightforward. By mastering this language, we can be confident in our control of the presentation of HTML documents.
What can we do with CSS?
- We use CSS to add styles to any HTML element visible on the page. These include the HTML tags used to create headings, links, paragraphs, lists, images, and tables.
- We can adjust our text size, colors, fonts, and element alignment.
- We can also animate our elements and create movement on a page.
- We can even change the presentation to suit different devices, such as large screens, small screens, or even printers. This is known as responsive web design, where we use CSS and HTML to resize, shrink, enlarge, hide, or move content on a page to make it look presentable on any device.
Knowledge of HTML syntax and how to use it to lay out a basic web document is essential for this course.