/    Sign up×
Community /Pin to ProfileBookmark

Coordinating divs vertically

Hi,

I’m currently trying to get into divs and I made a site with a table layout and am currently trying to transfer it to div positioning.

I came across a problem though.
My page consists of a banner at the top which stretches across the whole site and below that 2 columns: a side bar menu on the left (with a background image that repeats) and the content section to its right.

The problem is with the “second” row corresponding to the side bar (div#side1) and content (div#content) sections. When the content section is longer (height-wise) then the side bar section, the side bar section doesn’t accompany the content section down to the bottom.
Here’s my css code for the divs:

div#head {
position: absolute;
width:900px;
height:120px;
left:0px;
top: 0px;
background-color: #FFFAFA;
}
div#columns {
position: relative;
width: 900px;
top: 120px;
height:100%;
background-color: #FFFAFA;
}
div#side1 {
position:absolute;
width:115px;
height:100%;
top: 0px;
left:0px;
background-color: #FFFAFA;
background-image:url(lefthandsidebar.jpg);
background-repeat:repeat;
}
div#content {
position: relative;
width: 758px;
height: 100%;
top: 0px;
left: 282px;
background-color: #FFFAFA;
padding-top: 15px;
padding-right: 10px;
padding-bottom: 10px;
padding-left: 15px;
line-height: 18px;
}

I found an alternative way of doing it by putting the bg image of the side bar as the bg of the holder (div#columns) and for that I used the “background-repeat: repeat-y;” code.

If it is possible to do it another way I would be interested in finding out cus I’m stumped.

Here’s a link to the test page:
[url]http://www.snowvalley.ws/home5.html[/url]

And a link to the page with the “background-repeat:repeat-y”: [url]http://www.snowvalley.ws/homeBG.html[/url]

Thank you for your help!

to post a comment
CSS

4 Comments(s)

Copy linkTweet thisAlerts:
@drhowarddrfineAug 21.2005 — [CODE]margin:0px 0px 0px 0px;

margin-top: 0px;
margin-left: 0px;
margin-right: 0px;
margin-bottom: 0px;

[/CODE]

A lot of this is not necessary. margin:0; does the same as all the above.
[CODE]
letter-spacing: normal;
word-spacing: normal;
white-space: normal;
[/CODE]

These are also unnecessary since "normal" is the default.

Doesn't answer your question but ...
Copy linkTweet thisAlerts:
@AndrewF31authorAug 21.2005 — thanks for the tips!

totally missed out my repetition of the margin attribute. :eek:

Back to the pressing matter though. ?
Copy linkTweet thisAlerts:
@ray326Aug 21.2005 — IE doesn't even show your footer at all. Maybe that's a clue.
Copy linkTweet thisAlerts:
@AndrewF31authorAug 21.2005 — thanks for pointing that out. Didn't even notice that. BUT unfortunately, it didn't change my luck. The footer now shows up but the left hand side still doesn't repeat.

http://www.snowvalley.ws/home5.html

That's the link that matters now.

I noticed that if I don't have "height:100%" in the classes "content" and "sidebar", the bg color for both doesn't go all the way to the bottom.

Note:

I ended up finding an alternative solution for my problem by altering the bg image, making it the bg of the holder box (added snow white to the right side of the image) and now it works.

http://www.snowvalley.ws/home7.html

But if anyone knows how to do it another way, I would really like to hear it! Thanks again.
×

Success!

Help @AndrewF31 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.1,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...