David
David

Reputation: 969

HTML Float issue - should be simple but can't get it to work

I am trying to left align a div within a div that has been center aligned with margin: 0px auto; but i just can't seem to get it working, i know this is a simple issue but i just can't seem to get it to work...

any help would be brill !

PS - i have attached an image of the problem, just can see the left col is float-left but now the background (seen on the right) is creeping up...

alt text http://img96.imageshack.us/img96/1778/screenshot20091021at125.png

#wrap {
width: 940px; 
height: auto;
margin: 0px auto;
text-align: left;
background-color: #c3c1c1;
}

nav {
width: 220px;
height: auto;
float: left;
}

Upvotes: 0

Views: 228

Answers (2)

theraven
theraven

Reputation: 5035

For your outer div, try text-align:left; and for your inner div, try possibly float:left;.

Others will post nicer, cleaner answers, but this will get you started.

Upvotes: 1

Josh Mein
Josh Mein

Reputation: 28645

float:left should do the trick

EDIT: You can put all your text in another div that is float:left make sure to set the width properly though

Upvotes: 2

Related Questions