Skip to main content
Brave Programmer Logo

BraveProgrammer

BraveProgrammer

HomeProjectsBlogsCoursesLessonsAbout

Site footer

BraveProgrammer

Free coding courses, practical tutorials, and real projects from BraveProgrammer. Learn web development with React, Next.js, and TypeScript.

Navigation

  • Home
  • Projects
  • Blogs
  • Courses

Resources

  • About
  • Lessons
  • Teach on BraveProgrammer

© 2026 BraveProgrammer. All rights reserved.

Adding CSS to a Page | CSS Course lesson | BraveProgrammer
  1. Courses
  2. /
  3. CSS Course

Lesson 2 of 50

·css

Adding CSS to a Page

7 mins

Course progress4%

What you'll learn

Keep these ideas in mind as you work through the lesson.

3 points
  • Prefer external stylesheets for reusability and caching.
  • Inline styles have highest specificity but are hard to maintain.
  • Embedded `<style>` is useful for page‑specific or critical CSS.

There are three ways to include CSS:

  1. Inline – style attribute on an element.
  2. Embedded – <style> block inside <head>.
  3. External – <link rel="stylesheet" href="style.css">.

External CSS is the most maintainable and cache‑friendly.


Example: External Stylesheet Link

<link rel="stylesheet" href="/css/main.css" />
Make it stickPractice what you've learned1 quiz · 6 practical tests · Optional activities from CSS CourseBrowse activities
Previous lessonWhat is CSS?Continue to lesson 3Basic SelectorsBack to CSS Course curriculum