forum

Home / DeveloperSection / Forums / Div collapse after float css

Div collapse after float css

Anonymous User 2704 28-Dec-2012
Hi every one

I have a div called NAV and inside of NAV I have an UL with 5 li which I float to the left, the li's that is but when I do that the NAV collapses. I know this because I put a border around NAV to see if it collapses and it does.

This is my code

HTML 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

Updated on 28-Dec-2012
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By