Is there a way to prevent horizontal page scroll on a mobile device preferably with CSS only?
Here\'s an example: http://jsfiddle.net/YfLst/15/
Update:<
There are different ways to do that:
You could target mobile devices with a special stylesheet
And set the body width to 100% and overflow-x: hidden, or even try to position it absolutely
body {
width: 100%;
overflow-x: hidden;
position: absolute;
top: 0;
left: 0;
}
in css.
If by "preventing horizontal scrolling" you mean that your viewport (the area displayed on the mobile screen) is too narrow and should be bigger, you should set the viewport width accordingly in your meta tags