Link to home
Start Free TrialLog in
Avatar of jimbona27
jimbona27Flag for United Kingdom of Great Britain and Northern Ireland

asked on

floating div issue

hi EE,
I have a simple floating issue with two divs I have,
see the complete code below.
The two divs float as expected but when the browser width is too small for the divs they wrap around.  I need them to float beside each other (like they do) but even if the browser width is too small.
what css am I missing??  i've tried white-space: nowrap but it doesnt work for me by placing the code in the two divs.

please advise.
thanks
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <title>Untitled Page</title>
    <style>
        .left-panel
        {
            border: 1px solid red;
            width: 300px;
            padding: 10px;
            float: left;
        }
        .right-panel
        {
            border: 1px solid red;
            width: 300px;
            padding: 10px;
            float: left;
        }
    
    </style>
</head>
<body>
 
    <div class="left-panel">
        here 1
    </div>
    <div class="right-panel">
        here 2
    </div>
 
</body>
</html>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of yo_s_canta
yo_s_canta

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jimbona27

ASKER

thanks!