CSSIntroduction to CSS

CSS (Cascading Style Sheets) is a language used to style and design HTML pages. While HTML creates the basic structure of a webpage, CSS adds color, layout, fonts, and other visual elements to make the page look attractive and professional.

CSS works by selecting HTML elements and applying rules to them. Each rule has a selector (which targets elements) and a declaration (which defines the style).

For example, you can make a heading red or add a background color to a button. CSS is very flexible and allows you to create simple designs or complex layouts.

There are three ways to use CSS:

Inline CSS(directly inside an HTML tag),

Internal CSS (inside a <style> block in HTML),

External CSS (in a separate file linked to your HTML).

External CSS is the most popular because it keeps code clean and reusable. With CSS, you can also make websites responsive, meaning they adjust automatically for phones, tablets, and desktops. Modern CSS includes powerful features like animations, transitions, and flexible layouts using tools like Flexbox and Grid. Learning CSS is essential for web development because it brings life and personality to plain HTML pages, making them more engaging and user-friendly.

h1 { color: blue; font-size: 24px; }
p { color: gray; }