![]() |
|
||||||||||
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
|||||
|
|
#1 |
|
WLC Member
Join Date: Jun 2012
Posts: 11
|
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/ |
|
|
|
|
|
#2 |
|
Banned
Join Date: Jun 2006
Location: Blackp ool U.K.
Posts: 3,197
|
The "gap" is simply where you have not made an allowance for how position: relative; affects an element and the normal flow.
Last edited by chrishirst; 6th July 12 at 08:29 AM. |
|
|
|
|
|
#3 |
|
WLC Member
Join Date: Jun 2012
Posts: 11
|
Ok, I'll try too understand later today. Thanks
|
|
|
|
|
|
#4 |
|
WLC Member
Join Date: Jun 2012
Posts: 11
|
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. ![]() Now you can see how site looks with two widgets. |
|
|
|
|
|
#5 |
|
Banned
Join Date: Jun 2006
Location: Blackp ool U.K.
Posts: 3,197
|
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.
|
|
|
|
|
|
#6 |
|
WLC Member
Join Date: Jun 2012
Posts: 11
|
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?
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
Linear Mode |
|
|