Johan85
asked on
How to prevent horizontal scrollbar?
When using negative left margin, or negative left positioning, no horizontal scrollbar appear in the browser window.
However, when you use negative right margin, or negative right positioning, a scrollbar does appear.
I've set up an example:
http://jsfiddle.net/PPmeS/
Does anybody know of a way to prevent the scrollbar for content that is pulled out on the right side. In my case it's just a decorative photo which should be cut off if the window is too small.
Thank you.
However, when you use negative right margin, or negative right positioning, a scrollbar does appear.
I've set up an example:
http://jsfiddle.net/PPmeS/
Does anybody know of a way to prevent the scrollbar for content that is pulled out on the right side. In my case it's just a decorative photo which should be cut off if the window is too small.
Thank you.
Mhh normally you can use overflow-x:hidden to the parent
Update : in your Example you have the Overflow-x use on html,body ....
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Yes thats right....but this Info wash´t given *smile*
If i think about that you can try with another wrapper around that with 100% width and overflow-x:hidden
If i think about that you can try with another wrapper around that with 100% width and overflow-x:hidden
ASKER
Oh well, my bad, I forgot to remove the overflow-x declaration on html,body at the top. No wonder the media query had no effect. It works now:
http://jsfiddle.net/PPmeS/ 5/
http://jsfiddle.net/PPmeS/
ASKER
When the scrollbar appears, it still allows to scroll beyond the content width, but all in all this is a workable solution.