/    Sign up×
Community /Pin to ProfileBookmark

Attaching div to bottom or another div?

I’m new to CSS and learning as I go. Something that I can easily do with a table is kicking my butt.
I have a div with a vertically tiling background that is set to auto for the height to expand/contract bases on text within the div. I have another div at the top of it with a part of the background. I need to put one at the bottom as well, but I’m not sure how to attach the bottom div to the dynamic middle div. Is it even possible?

Thanks.

to post a comment
CSS

2 Comments(s)

Copy linkTweet thisAlerts:
@CentauriOct 14.2007 — Without seeing the code you are using, the bottom div could simply follow the content div and it will normally sit immediately under it. Alternately, a div can be internal to the content div and positioned absolutely at the bottom. Better still, if the bottom div is only to contain a background image, that background can be applied directly to the content div, positioned at the bottom, without using an extra div. Lots of possibilities.

Also, auto is the default height for a div and does not need to be explicitly specified - a div will naturally expand vertically with content.
Copy linkTweet thisAlerts:
@gtcwayauthorOct 14.2007 — Thanks, I think I've got it now. I inserted a div into the middle div and positioned it at the bottom. I really like the flexibility of CSS, just takes some getting used to.
×

Success!

Help @gtcway 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.18,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

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