Mark As Completed Discussion

In this lesson, we will explore the basics of CSS (Cascading Style Sheets) and its role in web styling.

CSS is a style sheet language used for describing the presentation of a document written in HTML. With CSS, you can control the layout, colors, fonts, and other visual aspects of your web pages. CSS allows you to separate the structure and content of your web page from its design, making it easier to maintain and update.

To use CSS, you can include the styles directly in the HTML document using the tag, or you can link an external CSS file using the tag. The styles defined using CSS selectors will be applied to the HTML elements that match those selectors.

Here's an example of CSS code that styles the ,

, and

elements:

SNIPPET
1// Replace with your CSS code here
2body {
3  background-color: lightblue;
4  font-family: Arial, sans-serif;
5}
6
7h1 {
8  color: red;
9  text-align: center;
10}
11
12p {
13  color: darkblue;
14  font-size: 18px;
15}
16
17/* This is a comment */
JAVASCRIPT
OUTPUT
:001 > Cmd/Ctrl-Enter to run, Cmd/Ctrl-/ to comment