New: Complete Beginner's Guide to Coding is now available in Premium
Updated: Indian Govt Exam roadmaps now include salary breakdowns & timelines
Tip: Use the Career Hub to explore all career paths in one place
Tutorials CSS CSS Introduction

CSS Introduction

CSS

CSS (Cascading Style Sheets) controls how HTML elements look — colors, fonts, spacing, layout.

HTML = structure. CSS = design. Together they create beautiful web pages.

3 Ways to Add CSS

  • Inline — style attribute on element
  • Internal — <style> tag in <head>
  • External — separate .css file (recommended!)
Example — CSS
/* External CSS file: style.css */
h1 {
    color: #4f46e5;
    font-size: 2rem;
    text-align: center;
}

p {
    color: #64748b;
    font-size: 1.1rem;
    line-height: 1.6;
}
Result

Styled Heading

This paragraph is styled with CSS. Notice the color, size, and spacing.