PDA

View Full Version : Scrollbar is offcentering the page...


crashNburn11
January 14th, 2004, 05:31 AM
I'm working on building a new website for our drum company, and I wanted to use frames for this site. The problem I'm having is that I'm trying to make each page on the site span 75% of the browser window. I have a fixed top and bottom frame, and all the links to the other pages are displayed in the middle frame. If you look at the "Shells (http://www.allstardrums.com/)" page, you'll see that the page is off-centered to the left because of the scrollbar. If I set the mainFrame to scrolling="NO", then it's centered perfectly. Anyone know an easy fix?

If you look at the "Lugs (http://www.allstardrums.com/)" page, you'll see that a friend of mine centered it pretty good, but I'm thinking someone probably knows an easier way than having to nest these 2 tables. The site still has a long way to go, it's still just in the very beginning phase and so am I at webdesign lol. Right now I'm just trying out some different ideas and stuff, but that problem with centering the page up is bugging me pretty bad.

Thanks for your help.

Steven.Bentley
January 14th, 2004, 08:39 PM
hmm I've had a look at the two pages you mention and I don't really see any difference in how they scroll.

Can I ask why you want to use frames for this particular site?

crashNburn11
January 14th, 2004, 11:21 PM
Hey Steven, thanks for the response.

Well, there's no difference in how they scroll that's not my problem, the problem for me is trying to center the page (to span 75% of the browser window and for the page to be centered correctly) and I figured someone probably new an easy way to fix it. Note that the navigation bar is set to 75% aswell, and that the page in the middle frame should line up with it.

If you look at the 'Lugs' page, you'll see a friend of mine centered it up pretty good, but he didn't do anything to the 'Shells' page...and if you look at it, you'll see that it's just a little off-centered to the left, it should match up with the navbar(which is set to 75% aswell) at the top but it doesn't, because the scroll bar being present makes it off center. For instance, if I turn off scrolling, then the page will be alligned how I want it. But ofcourse I want scrolling to be on, but like I said it pushes the document in the middle frame over a little less than a quarter inch or so to the left hand side.

And about using frames for this site, I just wanted to always have the navbar and logo there, also for looks and I'm probably just going to get rid of the bottom frame because it's pretty pointless. If the load times for the site are poor after optimizing the site then I'll probably just do away with using frames period. I still very new to webdesign and just wanted to try some different things and maybe learn a little more firsthand from trial and error.

Thanks again for your help

falcon1
January 15th, 2004, 01:32 AM
If i where you, i would dump the frames, and just make it as a table. I think frames are a bit outdated, and dont look as profesional as the alternatives. If you just set something up like this:

<table width="75%" align="center">
<tr>
<td>Here is your navigation bar...</td>
</tr>
<tr>
<td>Put all of your main content in this table cell</td>
</tr>
<tr>
<td>and now your bottom section</td>
</tr>
</table>

Unless i am missing something, i think that would be a better alternative to frames. Obviously it is going to look a bit more complicated than that, but you get the idea..lol :D Good Luck!

crashNburn11
January 15th, 2004, 05:48 AM
I might get rid of the frames and/or build a no frames site...but in the mean time, I sure would like to know how to simply center the freaking "Shells" page up with the navigationbar, that's all. I've read alot why and why not to use frames, and of course most webdesigners frown upon them, but I still want to try it.

Anyway, I just want to make sure we're clear on my question, because for some reason I think it's confusing people, but I'm not sure why. The "Shells" page is simply off center to the left....even though the width is set to 75% (width="75%")....and the reason why, is because the scrollbar. I really don't know how to describe it any better than how I have already in the other 2 posts. I can tell you though, that I know it's the scrollbar, because, if you turn of scrolling in the mainFrame....then you will see that the page will be centered perfectly (the way I want it), meaning, why in the world is the scrollbar pushing my page over to the left? And does anyone know a simple way to fix it? I didn't think this question really would be this hard for some of the veteran webdesigners on this forum. This simple or rather, what I thought to be simple question is a pain in the butt lol.

Thanks for any further help on this

TommyD
January 16th, 2004, 01:14 AM
The difference is in the html on the framed pages. I too have always had a problem with frames which worked it's way out when using tables...........

rockboy
January 16th, 2004, 01:17 AM
A workaround that might work is to add/change the leftmargin="0" to something like leftmargin="20px" or "2%" on the pages that don't line up. Experiment with the numbers to see what looks good. Easier than using tables for a simple aesthetic rather than functional change.