Forum Moderators: not2easy

Message Too Old, No Replies

CSS to align to Bottom Left of two column page

         

Daleos

9:26 pm on Jun 19, 2010 (gmt 0)

10+ Year Member



OK. Probably a bit of a newbie question but I'm stumped...

Imagine a standard webpage layout with a header and 2 column layout underneath with a column for the menu options on the left and the main content on the right.

I'm trying to get a 'sponsor' logo to sit under the menu options but the bottom of the column sitting level with the bottom of the content in the main content column. No matter what I try, the logo always ends up tucking itself directly under the menu options.

Now this site has several pages and the 'content' on each page might be any length so I don't want to fix it with hard positioning. Also, the end site will be editable via Contribute so the CSS should be able to deal with any amendments on the mainContent column's content without needing to tweak the css.

The html I have boils down to this..

----

<div id="container">
<div id="header">
/* Header Logo and text */
</div>
<div id="sidebar">
<div id="menulist">
/* menu list */
</div>
<div id="sponsorlogo">
<img src="sponsorlogo.png" width "150" height "100" />
</div>
</div>
<div id="mainContent">
/* Main blurb */
</div>
</div>

----

The only bits of CSS that I have that deal with layout are...

.container {
width: 780px;
margin: 0 auto;
}

.sidebar {
float: left;
width: 150px;
}

.mainContent {
margin: 0 0 0 155px;
}

.sponsorlogo {
display:block;
position:absolute;
bottom:0px;
left:0px;
}

Any ideas on how make this work?

max4

4:49 pm on Jun 27, 2010 (gmt 0)

10+ Year Member



Hi Daleos,

You're using IDs to define your elements but you've only defined css classes. Further, menulist has no definitions.

Max

briggl

6:19 pm on Jun 28, 2010 (gmt 0)

10+ Year Member



How about this?

<div id="container">
<div id="header">
/* Header Logo and text */
</div> <!-- end header -->
<div id="sidebar">
<div id="menulist">
/* menu list */
</div> <!-- end sidebar -->
</div> <!-- end menulist -->
<div id="mainContent">
/* Main blurb */
</div> <!-- end mainContent -->
<br clear="all" />
<div id="sponsorlogo">
<img src="sponsorlogo.png" width "150" height "100" />
</div> <!-- end sponsorlogo -->
</div> <!-- end container -->

Daleos

2:09 pm on Aug 6, 2010 (gmt 0)

10+ Year Member



Thanks. All sorted now. I forgot to paste in the menulist definitions and obviously fell for the class/ID schoolboy error.

I know the difference between the two but for the life of me, I can't stop mixing up the symbols.