💡 Tip: Login now to track your course progress and unlock your downloadable certificates instantly!

What is CSS

CSS (Cascading Style Sheets) is a stylesheet language used to control the appearance and layout of web pages.

While HTML is used to structure content (like headings, paragraphs, images), CSS is used to style that content — such as adding colors, fonts, spacing, and positioning.

With CSS, you can:

  • Change text colors and fonts
  • Add background colors or images
  • Control layout and spacing
  • Make responsive designs for different devices

👉 In simple terms:
HTML = Structure
CSS = Design / Styling

CSS Syntax
selector {
    property: value;
}

Attributes

PropertyDescriptionExample
colorSets the text colorcolor: red;
backgroundSets background color/imagebackground: yellow;
font-sizeSets text sizefont-size: 18px;
marginControls outer spacingmargin: 10px;
paddingControls inner spacingpadding: 10px;
CSS Example
<!DOCTYPE html>
<html>
<head>
    <title>What is CSS Example</title>
    <style>
        body {
            background-color: lightgray;
        }
        h1 {
            color: blue;
        }
        p {
            color: green;
            font-size: 18px;
        }
    </style>
</head>
<body>
    <h1>Welcome to CSS</h1>
    <p>This is a paragraph styled using CSS.</p>
</body>
</html>

Output

Browser Output

The page will have a light gray background
The heading will appear in blue color
The paragraph text will appear in green with larger font size

Browser Support

Chrome
Chrome
Firefox
Firefox
Edge
Edge
Safari
Safari
Opera
Opera
IE
IE9+
✅Yes✅Yes✅Yes✅Yes✅Yes✅Yes

Notes

  • CSS stands for Cascading Style Sheets It allows separation of content (HTML) and design (CSS) CSS can be applied in three ways:
  • Inline CSS
  • Internal CSS
  • External CSS
  • External CSS is the most recommended method for large projects

Conclusion

CSS is an essential part of modern web development that transforms simple HTML pages into visually appealing and user-friendly websites. By mastering CSS, you gain full control over how your web content looks and behaves across different devices.

Sign In Form

User your email and password to singn in

Don’t have an account, signup here : 

HTML5 & CSS3

Tools and Tutorials

Want a Website

Want a website for your business ?

Please fill out the details below, so we can reach out to you.

Registration Form

Signup to track your record and much more.

We have sent you an email with a registration link. Please click the link to verify your email address, or enter the 6-digit OTP provided in the email.

Didn't receive the OTP. Regenerate OTP Resend