I am trying to fix a bug with a website where the header contains two elements: div floated left and ul float right.
Usually two sit next to each other, but sometimes the contents of ul large, and since they connect the div, it remains on the line, but ul falls to the next line. I want to prevent this by sacrificing width on a div and having text on two lines.
The best I have been able to do so far is to set the width of the left div explicitly in px, but this does all two lines when it should be only when necessary. Everything that I tried to show, and the minimum / maximum width, did not affect much.
I will not post the full markup here, but it is a bit like this
<div id="minibasketAndLogin"> <div id="login"></div> <ul class="basketLoginList"> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> </ul> </ul>
Css is also quite confusing, so I wonβt include it here, but all of this can be found in this fiddle .
Basically, as ul stretches, the div should decrease, and the text wraps on the next line.
thanks
source share