YouTip LogoYouTip

CSS Tutorial - Getting Started

What is CSS?

CSS (Cascading Style Sheets) styles and layouts web pages.

Syntax

selector { property: value; }
h1 { color: blue; font-size: 2em; }
.class { background: #fff; }
#id { border: 1px solid black; }

Three Ways to Use CSS

<!-- Inline -->
<p style="color: red">Text</p>

<!-- Internal -->
<style> p { color: red; } </style>

<!-- External -->
<link rel="stylesheet" href="style.css">

Summary

  • CSS uses selectors to target elements
  • Properties define visual styling
  • External stylesheets are recommended
← CSS Selectors and SpecificityHTML5 Semantic Elements β†’