Home › Forums › CSS › Horizontal scroll issue related to vertical scroll problem when browser window not fully expanded…
- This topic is empty.
-
AuthorPosts
-
May 19, 2012 at 12:01 pm #38138mpsbMember
I am trying to design a photography gallery page in HTML and CSS with a relative header wrap div around a fixed header div (and the same for footer) with a main div that scrolls horizontally. I have finally worked all this out just fine, EXCEPT…
When the browser window becomes too small vertically, the div with the horizontal scroll starts to scroll vertically as well, causing an overlap with the header. Is there a simple CSS line of code fix to this please? I guess I’d like to make only the vertical positioning “fixed” while still allowing the horizontal scroll without having to use any other kind of complicated script/language etc.
You can see the page in question “here” and also the CSS file “here”.
My coding skills are minimal I know so no making fun of my CSS!
Thanks a million in advance for any advice…
May 19, 2012 at 1:11 pm #103102BillyParticipantYou can tell it not to scroll vertically (y axis):
.thing {
overflow-y: hidden;
}May 20, 2012 at 7:07 am #103127mpsbMemberThanks cyneWATCH but doesn’t seem to solve it. I am likely putting this in the wrong place though. Have tried it in both the CSS file and on the individual pages.
This is my CSS styling for the div I need not to scroll vertically:
#galleryWrap {
width:13000px;
height:514px;
float:left;
margin-left:9px;
}#indexWrap {
width:1024px;
height:514px;
float:left;
margin-left:9px;
}Should the hidden y-overflow go in here or somewhere else?
May 20, 2012 at 9:24 am #103130SenffParticipantDid you try putting the
overflow-y: hidden
on the BODY and/or HTML element?May 20, 2012 at 9:28 am #103132BillyParticipantSo it’s the body and html that scroll. You should make it this then”
body, html {
overflow-y: hidden;
}May 20, 2012 at 11:39 am #103137mpsbMemberThank you… This is close to working but not quite there… In FF 3.6.2 it stops the vertical scroll perfectly as I need but is now throwing in an ugly white horizontal scroll bar. I suppose by increasing the “height” of the footer div I can shoo this away further down the page (as you can’t control the styling of this can you?).
It does not work at all still in Safari 5.1.6 (but at least their horizontal scroll bar is less intrusive!
Can’t test IE until I get to my machine with Parallels on it tomorrow.
Any other ideas? I am searching away and trying various things but no joy this end.
May 20, 2012 at 12:00 pm #103139BillyParticipantIt works in Firefox and Opera, but it still scrolls in Safari and Chrome. I don’t think it’s too bad though, because otherwise you don’t know to scroll sideways.
You can style the scrollbar in Webkit (Chrome and Safari, Chris made a post on it) and you can use JavaScript to style it in other browsers.May 21, 2012 at 9:55 am #103190mpsbMemberThanks for all your help… I have it like this now and am happy in Safari & Chrome with custom scroll bar using Webkit.
Opera and Firefox won’t allow the Webkit to work.
Worse still is that sadly IE won’t show any scrollbar (or footer for that matter).
So I’ll be banging my head against my desk for a while on this final issue no doubt – may just have to pay someone to sort out the js for me for IE/FF custom scroll bars if that’s what you think I need to do. Bit beyond me.
Again, thanks for your assistance.
May 21, 2012 at 12:09 pm #103195BillyParticipantYou can style the IE scrollbar too, but in a different way (mentioned in Chris’ post too), and can probably make it scroll vertically by adding a conditional stylesheet: