---
title: "Div collapse after float css"  
description: "Div collapse after float css"  
author: "Anonymous User"  
published: 2012-12-28  
updated: 2012-12-28  
canonical: https://www.mindstick.com/forum/513/div-collapse-after-float-css  
category: "css-css3"  
tags: ["css-css3"]  
reading_time: 1 minute  

---

# Div collapse after float css

Hi every one \
\

*I have a div called NAV and inside of NAV I have an UL with 5 li which I [float](https://www.mindstick.com/interview/1718/describe-float-containment) to the [left](https://www.mindstick.com/articles/12768/don-t-be-left-behind-with-the-new-it-revolution), the li's that is but when I do that the NAV collapses. I know this because I [put](https://answers.mindstick.com/qa/111890/can-you-explain-the-difference-between-put-and-post-http-methods) a border around NAV to see if it collapses and it does.*

*This is my [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii)*

***[HTML](https://www.mindstick.com/articles/1530/design-a-simple-stylish-calculator-using-html-css-and-javascript) Code***

```
<div id="nav">        <ul id="ullistNavi">            <li><a href="#">Home</a></li>            <li><a href="#">About Us</a></li>            <li><a href="#">Contact Us></a></li>            <li><a href="#">Download</a></li>            <li><a href="#">Service</a></li>        </ul>    </div>CSS <style type="text/css">        #nav #ulListNavi a        {            float: left;        }</style>
```

Thanks in [advance](https://www.mindstick.com/blog/33258/jee-mains-and-jee-advance-exams)

## Replies

### Reply by AVADHESH PATEL

Hi Ankit Singh\
you can try this\
Add any overflow value other than visible to your container:\
div#nav { overflow:auto; }Then add width to restore the width\
div#nav { width: 100%; overflow:auto; }


---

Original Source: https://www.mindstick.com/forum/513/div-collapse-after-float-css

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
