Forum Moderators: not2easy

Message Too Old, No Replies

CSS Space/Scroll Issue

css space issue for my website

         

trent241

4:07 am on Jan 12, 2010 (gmt 0)

10+ Year Member



<snip>

I have a spacing issue on my template that I cannot seem to figure out how to get rid of.

When the page loads, it looks and views like it supposed to, however, it scrolls to the right with a bunch of dead space that is unnecessary.

I believe this is the culprit -

CSS Code:

#bottomwrapper { width:100%;
background:transparent url(../images/footer_bkg.png) repeat-x;
float:left;
position:relative;
font-size:12px;
color:#FFF;
height:185px;
padding-left:30px;
padding-right:30px;
padding-top:10px;
}

If I take out Width:100% the background for the bottomwrapper is too small, and if I add it, it extends the side scroll.

And the PHP where I call the css is as follows:

<?php if ($this->countModules('bottom-fixed')) { ?>

<div id="bottomwrapper"><div id="bottomwrapper-inner" style="width:<?php echo $overallwidth;echo $overallwidthpxper;?>">

<jdoc:include type="modules" name="bottom-fixed" style="xhtml" />

</div></div>

<?php } ?>

I have tried taking the 100% width from the CSS and placing it in the bottomwrapper div tag, but the same issue arises.

Any ideas would be greatly appreciated. Thank you.

[edited by: limbo at 11:07 am (utc) on Jan. 12, 2010]

monie

5:23 am on Jan 12, 2010 (gmt 0)

10+ Year Member



When you set a width, it sets the width for the content, and margins and padding are added onto that afterwards. I wonder if width: is setting the width of the content div to 100% of the page and you have margins and padding somewhere that are adding empty space.

By the way, what happens if you set the width to 95%?

And just so you know, you're not supposed to include your site's domain name in your post.

trent241

5:40 am on Jan 12, 2010 (gmt 0)

10+ Year Member



Thanks for the info. I would edit the url how it is supposed to be, however, it is past the allotted time and wont allow me to.

I use firebug, and loaded the page and checked the margins, which for the parent are 0. I have loaded turned off each portion of the css directly related to the bottomwrapper, and the only thing that removes the extra scroll is to disable the width. However, when I do that, the image does not span across the entire page.

I made the change to 95% as you suggested. It seems to be a good short term fix.

monie

11:09 am on Jan 12, 2010 (gmt 0)

10+ Year Member



I wouldn't worry about it. :) Most people seem to break a rule their first post here (me included) and they're pretty forgiving.

Cool. The only problem with the 95% thing is that, if the empty space is wider than 5% of the page, the horizontal scrollbar will still appear.

But the fact that it changes is a good thing. It indicates that the problem is probably that "bottomwrapper" is being set to the width of the page, and something else is adding onto that--making the total width > 100% of the window, so the scrollbar appears.

What is the rest of the structure of the page? Don't post all your html, but could you post something that gives a general idea of what blocks contain what?

What happens if you run it with padding-left AND padding-right turned off--does the empty space to the right get smaller?

PS Remember that padding increases the total width/height too, even though it's inside the border.

Drag_Racer

8:40 pm on Jan 12, 2010 (gmt 0)

10+ Year Member



trent, is it possible to remove the 'float' property in your bottomwrapper? If you can, the DIV will automatically expand to the 100% width without declaring 'width:100%' and you can still use padding without it causing the scrollbar to appear.

trent241

12:17 am on Jan 13, 2010 (gmt 0)

10+ Year Member



monie - I turned off padding left and right, nothing happens, it only affects the interior of the div.

Drag - I removed the float to see and it jumps to the top of the page and adds the extra space as before.

monie

12:49 pm on Jan 14, 2010 (gmt 0)

10+ Year Member



Darn. :/ I'm kinda stumped. At least the 95% thing is a short-term fix.

Is there another div you could put
background:transparent url(../images/footer_bkg.png) repeat-x;
in? Then you'd still have the background and could remove width:100% from bottomwrapper.

trent241

2:52 pm on Jan 14, 2010 (gmt 0)

10+ Year Member



Im stumped as well, I have the top menu wrapper with the exact same code and 100% and it works just fine, and when I do the bottomwrapper at 100% something goes haywire.

I just have the innerwrapper div on that and, unfortunately with the way the padding/spacing is setup, would look kind of funny. My next option I guess would be to slice up the image and apply it throughout the bottomwrapper divs?