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.

Overflow & Scrollbars | CSS Course lesson | BraveProgrammer
  1. Courses
  2. /
  3. CSS Course

Lesson 13 of 50

·css

Overflow & Scrollbars

6 mins

Course progress26%

What you'll learn

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

3 points
  • `overflow:hidden` can be used for **CSS‑only cropping** and to hide scrollbars.
  • `overflow:auto` gives browsers the ability to add scrollbars when necessary.
  • `scroll-snap` works together with overflow for carousel‑like UX.

Controls what happens when content exceeds an element’s box.

  • overflow:visible – default, content spills out.
  • overflow:hidden – clips overflow, useful for UI tricks.
  • overflow:auto – adds scrollbars only when needed.
  • overflow-x / overflow-y – control each axis independently.

Example: Horizontal scroll gallery

.gallery {
  display:flex; overflow-x:auto; gap:1rem; padding:1rem;
}
Make it stickPractice what you've learned1 quiz · 6 practical tests · Optional activities from CSS CourseBrowse activities
Previous lessonFloating & ClearingContinue to lesson 14Visibility & OpacityBack to CSS Course curriculum