HTML5ANDCSS3 logoHTML5ANDCSS3Tools and Tutorials
  • Insights
  • Verify Certificate
HTML5ANDCSS3 logoHTML5ANDCSS3Tools and Tutorials
HTML5ANDCSS3 logoHTML5ANDCSS3Tools and Tutorials

HTML5andCSS3.org helps developers learn modern frontend skills with practical tutorials, production-ready snippets, and fast web tools built for everyday coding.

Quick Links

  • About Us
  • Contact Us
  • Privacy Policy
  • Copyright
  • Disclaimer

Top Tools

  • Try It Editor
  • JSON Formatter
  • CSS Minifier
  • HTML Minifier
  • Base64 Encoder / Decoder

Contact

  • business@html5andcss3.org
Newsletter

Learn at your own pace, practice with useful tools, and build websites you're proud of.

© 2011-2026 html5andcss3.org. All rights reserved.

How to Use

CSS Tutorial

CSS Introduction

What is CSSCSS SyntaxHow to Add CSSCSS Comments

CSS Foundations

Cascade & InheritanceCSS SpecificityCSS UnitsBox SizingCSS VariablesCSS Math Functions

CSS Selectors

CSS Element SelectorCSS Class SelectorCSS ID SelectorCSS Universal SelectorCSS Group SelectorCSS CombinatorsCSS Attribute SelectorsCSS Pseudo ClassesCSS Pseudo Elements

CSS Colors and Backgrounds

CSS ColorsCSS HEX ColorsCSS RGB ColorsModern ColorsCSS Background ColorCSS Background ImageLayered Backgrounds

CSS Text & Fonts

CSS Text ColorCSS Text AlignmentCSS Text DecorationCSS Font FamilyCSS Font SizeWeb Fonts & TypographyText Wrapping

CSS Box Model

CSS MarginCSS PaddingCSS BorderCSS OutlineCSS Width and Height

CSS Layout

Normal FlowCSS DisplayCSS PositionAnchor PositioningCSS FloatCSS OverflowCSS Z-indexIntrinsic SizingAspect Ratio & Object FitMulti-column Layout

CSS Flexbox

Flex ContainerFlex DirectionJustify ContentAlign ItemsFlex WrapFlex Item Sizing

CSS Grid

CSS Grid ContainerCSS Grid ColumnsCSS Grid RowsCSS Grid GapCSS Grid Layout ExampleGrid PlacementGrid AreasCSS Subgrid

CSS Lists, Tables & Forms

CSS ListsCSS TablesCSS Form StylingCSS Input Fields

CSS Effects

CSS ShadowsCSS GradientsCSS FiltersCSS OpacityClipping & MaskingBlending & BackdropScroll Snap

CSS Animations & Transitions

CSS TransformCSS 2D TransformCSS 3D TransformCSS TransitionsEntry & Exit TransitionsCSS AnimationsScroll AnimationsView TransitionsMotion Paths

CSS Responsive Design

CSS Media QueriesResponsive LayoutMobile First DesignContainer QueriesPreference Media QueriesFeature Queries

Modern CSS Authoring

Cascade LayersNesting & ScopeLogical PropertiesGenerated Content

CSS Accessibility

Accessible CSSCSS ThemingModern Form StylingCSS User Interface

CSS Output & Performance

Print StylesCSS PerformanceCSS ArchitectureDebugging CSS

CSS Reference

CSS At-rulesCSS FunctionsCSS Tutorial PDF

CSS Projects

Responsive CSS Project
  1. Home
  2. /
  3. Tutorials
  4. /
  5. CSS Tutorial
  6. /
  7. What is CSS

CSS Introduction

What is CSS

Learn how CSS controls presentation, layout, spacing, typography, color, and responsive behavior while HTML continues to provide the document structure.

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. The supporting concepts are explained in CSS Syntax and How to Add CSS.

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

css

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 is a constraint system

CSS does more than decorate individual elements. It resolves competing declarations, computes values, creates formatting contexts, and adapts the result to content, available space, device capabilities, and user preferences. Good CSS describes relationships and constraints instead of hard-coding one screenshot. The browser then performs the final layout for the actual document and environment.

CSS Example

html

<!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>

Browser Support

Feature
Chrome
Edge
Firefox
Safari
Core CSS styling11211

Versions show the first stable desktop release with unprefixed support. Data source: MDN Browser Compatibility Data 8.0.8.

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.

NextCSS Syntax

Keep the complete tutorial

Download the CSS tutorial as a PDF for offline study.

Download CSS Tutorial PDF