# CSS Float



## Wozzer (Oct 14, 2008)

Hello all,

As said in a previous topic I made a while ago, i'm attempting to learn CSS and HTML. So far - its all well, but I've hit my first problem. 

I want to create another side box to the left (As a navigation) but, instead of the box going underneath the above box, it goes to the right hand side. I'm pretty sure this has some thing to do with the "float". Below is the CSS / HTML and a screenshot.

==========
HTML
==========

<div id="leftnav">
<p>
Login box tester. 123456</p>
</div>

<div id="leftnav2">
<p>Search Box</p>
</div>

==========
CSS
==========
#leftnav
{
float: left;
width: 160px;
margin: 0;
padding: 1em;
}

#leftnav2
{
float: left;
width: 160px;
margin: 0;
padding: 1em;
}

==========
Screenshot
==========








Thanks in advance,

Wasley


----------



## Wozzer (Oct 14, 2008)

Another quick question,

What is padding. I've taken the padding away from a box and I can notice a diffrence in side. But is it needed? Whats the point of it?


----------

