# navbar won't float left

**URL:** https://boards.straightdope.com/t/navbar-wont-float-left/634825
**Category:** Factual Questions
**Created:** [September 15, 2012, 10:32pm UTC](https://boards.straightdope.com/t/navbar-wont-float-left/634825 "2012-09-15T22:32:02Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Snarky\_Kong](https://avatars.discourse-cdn.com/v4/letter/s/a183cd/32.png) [@Snarky\_Kong](https://boards.straightdope.com/u/Snarky_Kong)
#### Post date: [September 15, 2012, 10:32pm UTC](https://boards.straightdope.com/t/navbar-wont-float-left/634825/1 "2012-09-15T22:32:02Z")

</div>

I’m just learning html and css, and I can’t get my navbar to go all the left of the body ([http://postimage.org/image/mvfj1jnnn/](http://postimage.org/image/mvfj1jnnn/)).

The CSS is:

.nav li{  
display:block;  
margin:0 0 10px 0;  
width: 25%;  
text-align: center;  
float: left;  
color:#123456;  
font-size: 20px;  
border-style: solid;  
border-width: 1px 0 1px 0;  
border-color:#123456;}

The text below obviously goes to the border. Any ideas?

---

<div class="post-metadata">

### Author: ![handsomeharry](https://avatars.discourse-cdn.com/v4/letter/h/e9c0ed/32.png) [@handsomeharry](https://boards.straightdope.com/u/handsomeharry)
#### Post date: [September 16, 2012, 6:00am UTC](https://boards.straightdope.com/t/navbar-wont-float-left/634825/2 "2012-09-16T06:00:59Z")

</div>

I’m something of a newbie also, but, isn’t one supposed to use the id (#) rather than the (.) before the navbar? Also, after the “li” put a space. Then, rather than 25%, make it something like 250px, etc…

That would be my next step.

Sorry if it doesn’t work. Like I said, I’m a newbie too.

---

<div class="post-metadata">

### Author: ![Snarky\_Kong](https://avatars.discourse-cdn.com/v4/letter/s/a183cd/32.png) [@Snarky\_Kong](https://boards.straightdope.com/u/Snarky_Kong)
#### Post date: [September 17, 2012, 2:15am UTC](https://boards.straightdope.com/t/navbar-wont-float-left/634825/3 "2012-09-17T02:15:22Z")

</div>

The .nav is a class, not id so the period is correct. I changed it all to divs, and that worked.

---

<div class="post-metadata">

### Author: ![GuanoLad](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/guanolad/32/42_2.png) [@GuanoLad](https://boards.straightdope.com/u/GuanoLad)
#### Post date: [September 17, 2012, 2:52am UTC](https://boards.straightdope.com/t/navbar-wont-float-left/634825/4 "2012-09-17T02:52:16Z")

</div>

You can’t float left a List Item. You have to float left the Unordered List instead.
