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

© 2026 BraveProgrammer. All rights reserved.

  1. Courses
  2. /
  3. CSS Basics to Advanced

Lesson 14 of 50 · css

Visibility & Opacity

Duration: 5 mins

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; }
Previous: Overflow & ScrollbarsNext: Backgrounds – Images & Gradients