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.

Visibility & Opacity | CSS Course lesson | BraveProgrammer
  1. Courses
  2. /
  3. CSS Course

Lesson 14 of 50

·css

Visibility & Opacity

5 mins

Course progress28%

What you'll learn

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

2 points
  • `display:none` removes from the layout and accessibility tree, while `visibility:hidden` only hides visually.
  • `opacity:0` is often paired with CSS transitions for smooth fades.

Two ways to hide elements:

  • visibility:hidden – element is invisible but still occupies space and is read by screen readers.
  • opacity:0 – element is fully transparent but still participates in layout and events.

Both are useful for animation start‑states.


Example: Fade‑in transition

.hidden { opacity:0; transition:opacity .3s ease; }
.visible { opacity:1; }
Make it stickPractice what you've learned1 quiz · 6 practical tests · Optional activities from CSS CourseBrowse activities
Previous lessonOverflow & ScrollbarsContinue to lesson 15Backgrounds – Images & GradientsBack to CSS Course curriculum