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

jimbona27Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

yo_s_cantaCommented:
You need set overall with Try this:
<!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;
        }
    	#all {
			width:644px;
		}
    </style>
</head>
<body>
 <div id="all">
    <div class="left-panel">
        here 1
    </div>
    <div class="right-panel">
        here 2
    </div>
 </div>
</body>
</html>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jimbona27Author Commented:
thanks!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
CSS

From novice to tech pro — start learning today.