What is CSS?
CSS (Cascading Style Sheets) is the language used to style web pages. After learning HTML to structure content, CSS allows you to make pages visually appealing, professional, and responsive.
Why CSS Matters
- Separation of content and design – HTML handles structure; CSS handles appearance.
- Consistency – Apply styles across multiple pages with a single file.
- Efficiency – Change the look of an entire site by editing one CSS file.
- Flexibility – Control layout, colors, fonts, spacing, and more.
The Difference Between HTML and CSS
HTML defines the meaning and structure of content (headings, paragraphs, links). CSS defines how that content is displayed (colors, sizes, positions).
How CSS Works
CSS uses a rule-based syntax: selectors target HTML elements, and declarations apply styling properties. For example:
h1 {
color: blue;
font-size: 24px;
}
This rule makes all <h1> elements blue with a font size of 24 pixels.
Three Ways to Apply CSS
- Inline CSS – Added directly to an HTML element using the
styleattribute. Best for single-element overrides. - Internal CSS – Placed inside a
<style>tag in the HTML<head>. Useful for single-page styles. - External CSS – Written in a separate
.cssfile linked via<link>. Preferred for multi-page projects and maintainability.
What You'll Learn in This Class
- CSS syntax and structure
- The importance of CSS in frontend development
- How to use inline, internal, and external styles
- Practical examples to style your first web page
This class is perfect for beginners, students, and aspiring frontend developers. By the end, you'll be able to write CSS rules correctly and apply styling to any webpage.