CHAPTER 1

CSS Introduction

CSS is used to style HTML webpages and control their colors, spacing, layout, fonts and visual appearance.

01. What is CSS Introduction?

CSS stands for Cascading Style Sheets.
HTML creates the structure of a webpage, while CSS controls its presentation.
CSS can change colors, fonts, spacing, borders, backgrounds and layouts.
CSS helps create responsive and attractive websites.

02. Syntax

selector { property: value; }

03. Example

CSS / HTML Example AIFA Coding Lab
<!DOCTYPE html>
<html>

<head>

    <title>CSS Introduction</title>

    <style>

        h1 {
            color: blue;
            text-align: center;
        }

        p {
            color: #555;
            font-size: 18px;
        }

    </style>

</head>

<body>

    <h1>AIFA Infotech</h1>

    <p>
        Welcome to the AIFA CSS Coding Lab.
    </p>

</body>

</html>

04. Important Points

✓ CSS can be written inline, internally or externally.
✓ A CSS rule normally contains a selector, property and value.
✓ One HTML element can have multiple CSS properties.
✓ External CSS is generally useful for larger websites.

05. Common Mistakes

⚠ Forgetting the semicolon after a CSS declaration.
⚠ Writing an incorrect selector.
⚠ Using a CSS property with an invalid value.

06. Real World Use

CSS is used on almost every modern website to create the visual design and responsive layout.

Ready to Practice? 🚀

Open the AIFA CSS Editor and practice this chapter live.

Try It Yourself →
Practice Exercise

Create Your First Styled Page

Create an HTML page with a heading and paragraph. Use CSS to change the heading color and paragraph font size.