CSS Introduction
CSS is the language we use to style an HTML document. CSS describes how HTML elements should be displayed.
What is CSS?
CSS stands for Cascading Style Sheets.
CSS describes how HTML elements are to be displayed on screen, paper, or in other media.
CSS saves a lot of work. It can control the layout of multiple web pages all at once.
External stylesheets are stored in CSS files.
Why Use CSS?
CSS is used to define styles for your web pages, including the design, layout and variations in display for different devices and screen sizes.
Example 1: A Simple CSS Example
Here is a simple example of how CSS can style an HTML document.
My First CSS Example
This is a paragraph.
Example 2: Styling Multiple Elements
You can style multiple elements at once. In this example, we style all <p> elements to be red and center-aligned.
Hello World!
These paragraphs are styled with CSS.
Example 3: Changing Background Colors
CSS allows you to change the background color of any element.
Example 4: Adding Borders
You can easily add borders to elements.
This paragraph has a border.