Name: Zenno Date: June 9, 2004 at 12:49:15 Pacific Subject: Unwanted horizontal scrollbar OS: Windows XP CPU/Ram: P4 1.8 / 1.5 G
Comment:
Suppose you have a very basic web page (no frame at all) with just one graphic (not the background image) that is bigger than 800x600.
Of course, at 800x600 or lower resolution, scrollbars will appear.
Is there a way to allow only the vertical scrollbar to appear ? I know that i won't be able to see the graphic completely horizontally in that manner but it's only an example to simplify my question.
correct me if im wrong, but that picture doesnt need to be 800x600 does it? i'd say about 99.9% of people that matter that have computers use a res of at least 640x480 (a pick of 600x400 would probably fit in their browser fairly well), so if you changed the res of your pic to that much, then it wouldnt be a problem at all. (or cut the side part off since its not a big deal as you said and make it 600x600)
second solution. are you actually just showing a pic or you want some other stuff? if you are just showing a pic, you could make a link straight to the picture like,
Ok, look, i have a web page that is much more complicated than that, with iframes, css and everything, so i guess i'm an experienced user.
I just use the example of a simple web page with one big picture inside just to ask ONLY what i was interested in and not to confuse anyone.
It's just that i can't find anywhere on the web that winning script that could allow to have only a vertical scrollbar even if i do need an horizontal one.
I want this scrollbar thing to apply on my main page only NOT my iframe or other frames inside my main page.
b0red was actually on the right track...The overflow property is shorthand for the overflow-x and overflow-y properties. You can set them individually just like you set the overflow property (auto, scroll, hidden, inherit etc.)
I don't know which browsers support them...You can test that yourself. It seems to be part of the CSS2 standard though. I know for sure IE6 supports it.
Zenno- My guess is that you're trying to do this to an i-frame? If so, you should put something like <STYLE> HTML { overflow-x: hidden; overflow-y: auto;} </STYLE>
in the page that is being framed, not the one that contains the iframe.
Search for overflow-x on msdn.microsoft.com and you'll get some more info on how IE6 handles it.
here's the code i'm using, can someone tell me what's wrong:
html { overflow-x:hidden; overflow-y:auto; }
And finally, here is the web page: http://www.familleboutet.com/familleboutet.com/
Watch it in 800x600.
I know that my graphic is 780 pixels wide which is allright but there is extra space making the horizontal scrollbar appear that is caused by the fact that my graphic is presented in a table and that this table has a few extra empty cells at the right necessary to make the whole thing holding up together correctly.
So as you can see, the problem is on my main page, and my main page is not an iframe so i cannot use this script:
Zenno- This one is my fault. I misread MSDN's documentation. I thought that it was saying that overflow applied to the HTML object (which I thought was strange) but really it was just referring to the CSS as HTML...
Anyhow, it should be BODY {overflow-x: hidden; overflow-y: auto;} rather than HTML. I tested it with an 830x200 image, and it worked in IE6, but not in NS 7.1. It seems to be a part of CSS3, so it will hopefully be fully supported soon.
Zenno- This time it's not my fault :-) You left overflow: auto in the body CSS, which is overriding the overflow-x and overflow-y properties declared earlier. Take out overflow: auto and it works.
The information on Computing.Net is the opinions of its users. Such
opinions may not be accurate and they are to be used at your own risk.
Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE