Overriding overflow-x CSS property on iOS
Tried overflow-x: visible;
instead? Also I don't believe the !important
s are necessary.
iOS overflow-x (or position absolute) makes scrolling choppy?
You could try setting width:100%
on .page-wrapper
and set that to overflow:hidden
and position:relative
. That might prevent the horizontal scroll.
Updated 10/12/2012
Thanks for the code example. It really helped me see your intent and the issue with scrolling more clearly. It looks like you need -webkit-overflow-scrolling. Add -webkit-overflow-scrolling: touch;
to page-wrapper
. Here's an [updated test page] with that rule applied. You can compare with test page in my comment below to see the difference.
overflow-x: auto on iPhone is not scrolling
I saw in your sources that you use bootstrap so why you don't just adapt the with to be all inside the screen without any scrolling (horizontal scrolling on cellphone is not really user-friendly for me).
If you really want to use scrolling, I recommend you to use:
-webkit-overflow-scrolling: touch;
instead of
-webkit-overflow-scrolling-x: touch;
Have you tried to use !important
?
Overflow-x value ignored in mobile safari
Add html { overflow: hidden; }
to your CSS and it should fix it.
Allow horizontal scrolling when window is a specific width with overflow-x:hidden
Yes, you can switch the value of overflow-x
on-the-fly with a media query:
@media (max-width: 600px) {
body {
overflow-x: auto;
}
}
Be sure to place this @media
rule after your main body
rule in your stylesheet, otherwise your overflow-x: hidden
declaration will always take precedence.
Note also that while the width
media feature corresponds to the width of the viewport, and the body
element is not the same thing as the viewport, setting overflow-x
this way does in fact affect scrollbars on the viewport and not the body
element, which means it works as expected even if your body
element is narrower than it would normally be, or you haven't removed its default margins (as authors would usually do). This is intentional behavior, though it may be overridden under certain circumstances.
Related Topics
Attr as Property in CSS Selector
How to Display Block Div on Hover a Tag
How to Make The Elements Cover 100% of The Space Available in a Container Using Flexbox
CSS: Is It Correct That Text Content of a Div Overflows into The Padding
Create a Rotating Cube with Only CSS
Twitter Bootstrap Text Field's Height Too Small
CSS Minify and Rename with Gulp
Facebook Like Button - How to Disable Comment Pop Up Box
Neatly Display Images of Different Sizes Sequentially in The Same UI Element
CSS - How to Make Responsive Images
About Responsive Sites, Pixels, and Density
How to Show a <Div> by Clicking an Image in CSS