LearnHub
Back to Tutorials
Frontend

CSS Basics

Style your web pages with colors, fonts, spacing, and responsive layouts.

CSS (Cascading Style Sheets) controls how HTML elements look on screen. You can change colors, fonts, spacing, sizes, and positioning.

Styles can be written inline, inside a <style> block, or in an external stylesheet. External stylesheets are the most common and maintainable approach.

CSS selectors target elements to apply styles. For example, h1 { color: blue; } changes all headings to blue. Classes and IDs give you more precise control.

Modern layouts use Flexbox and Grid. These tools make it easy to build responsive designs that look good on phones, tablets, and desktops.