View Full Version : Gap between sidebar and footer
5th July 12, 06:27 PM
Hello, I am creating my first own theme for wordpress.
So my problem is that I don't know how to remove the gap between sidebar and footer. My sidebar uses relative postioning with negative top value. What I need to do to remove that empty space? I noticed that the gap has same height as my negative top value, which is -55px.
The gap disappears only when sidebar is smaller in height than content.
My site URL is http://pcfix.site40.net/neo/
5th July 12, 11:09 PM
The "gap" is simply where you have not made an allowance for how position: relative; affects an element and the normal flow.
6th July 12, 07:27 AM
Ok, I'll try too understand later today. Thanks
6th July 12, 11:07 AM
I made changes to footer, I added same position as sidebar: relative and top -55px. Everything looks good when i add more than two widgets, because then sidebar, which also has relative position is near footer (sibling elements).
The problem is when I add only one or two widgets, then content, which is static, becomes sibling of footer and footer then overlaps content. I can't add relative position to content because it will overlap menu. I want to make everything look correct no matter how many widgets I add. I don't what to write in this situation. :S
Now you can see how site looks with two widgets.
6th July 12, 03:18 PM
You need to restore the normal flow AFTER the relative positional shift. This is done by giving the positioned element a negative bottom margin of the same dimensions of the top property, or giving the adjacent sibling of the shifted element a negative TOP margin.
7th July 12, 01:46 PM
Thank you very much. Now everything is clear. I understand that when element is positioned relative, static position doesn't change and we must correct that by adding negative margin to bottom, to move not only element, but also static (default) position. Am I correct?
vBulletin® v3.8.4, Copyright ©2000-2013, Jelsoft Enterprises Ltd.