Introduction to CSS

What is CSS?

CSS (Cascading Style Sheets) is a stylesheet language used to describe the presentation of a document written in HTML. It allows you to control the layout, colors, fonts, and overall appearance of a webpage.

How CSS Works

CSS works by selecting HTML elements and applying styles to them. It can be applied in three ways:

Inline CSS (inside the HTML element)

Internal CSS (within a <style> tag in the <head> section)

External CSS (linked via an external .css file)

Example:

<!DOCTYPE html>
<html>
<head>
    <style>
        p {
            color: blue;
            font-size: 16px;
        }
    </style>
</head>
<body>
    <p>Hello, this is a blue paragraph!</p>
</body>
</html>