Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS: Scrollbar for y-axis causes scrollbar for x-axis

Tags:

css

Here's a screenshot of the problem.

enter image description here

Basically, when the scrollbar shows up for the y-axis, the width of the container doesn't expand. Instead it just creates a scrollbar for the x-axis.

How can I get the container to expand without creating the x-axis scrollbar?

like image 738
Laran Evans Avatar asked Apr 24 '11 05:04

Laran Evans


People also ask

How do I fix the scroll bar in CSS?

The easy fix is to use width: 100% instead. Percentages don't include the width of the scrollbar, so will automatically fit. If you can't do that, or you're setting the width on another element, add overflow-x: hidden or overflow: hidden to the surrounding element to prevent the scrollbar.


1 Answers

you can give this a try for the element:

overflow-x: hidden;
overflow-y: auto;

you can use scroll or auto for the overflow-y

here is a page with some samples: http://www.brunildo.org/test/Overflowxy2.html

like image 172
nonopolarity Avatar answered Sep 19 '22 20:09

nonopolarity