bayliss_trevor — 2011-11-28T12:56:08-05:00 — #1
Hi all I have been playing around with this footer (id=bottom) but although I did a horrible hack adding margin-top:600px it is obviously not a good solution, I have done several different things but to no avail and I don;t know the best solution: http://tinyurl.com/84ovgvu Thanks
technobear — 2011-11-28T13:06:26-05:00 — #2
Replacing the margin-top with clear:both seems to do it, unless I've misunderstood the problem.
victorinox — 2011-11-28T13:44:43-05:00 — #3
Positioning elements with margins where content is of variable height is not a sound approach.
Technobear is right that clear:both; is appropriate but this alone will not allow you to add a top margin to #bottom.
bottom is, in effect, a footer and unrelated to the main content of the page. Wrap everything inside #main, from the h2 down to but not including #bottom, in a new div, perhaps with the id #content.
Then give #content overflow:hidden, to that it wraps around the floated elements it contains.
Then give #bottom clear:both and whatever top margin you wish.
margin-top: 30px; /* or whatever you like */
bayliss_trevor — 2011-11-28T15:14:18-05:00 — #4
Thanks Technobear that works great. Thanks Victorinox I'll do that solution when I have a moment.