Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Div scaling with browser resize
Old 08-08-2010, 05:45 PM Div scaling with browser resize
Skilled Talker

Posts: 90
Trades: 0
Hey all,

This is a novice question, I'm sure, but it's giving me fits...

Basically, I have two floating divs side-by-side with a containing div that stretches the length of the browser window. I want the left div, the nav panel, to be a set width, and the right div, to shrink with the browser.

The problem is that as it shrinks, the right div pushes the left one down, instead of just contracting as much as possible.

Here's the CSS:
Code:
#user_left_content {
    display: block;
    float: left;
    width: 200px;
    margin-right: 10px;
}

#user_right_content {
    display: block;
    float: right;
    width: 65%;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    border: 1px solid #949494;
    padding: 5px;    
    min-height: 200px;
}
Thanks in advance!
msaz87 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-08-2010, 05:47 PM Re: Div scaling with browser resize
ModDish's Avatar
Super Talker

Posts: 116
Trades: 0
try floating both left, for they are side by side, then setting the width to 100% on the right.
__________________
Thanks
Evan
From ModDish -
Please login or register to view this content. Registration is FREE
ModDish is offline
Reply With Quote
View Public Profile
 
Old 08-08-2010, 05:53 PM Re: Div scaling with browser resize
Skilled Talker

Posts: 90
Trades: 0
Switched them both to left, but I couldn't do 100% width with the left margin, or it pushes off the page. With the way it is now, they stack, so they're not side-by-side anymore.

Any ideas?

Code:
#user_left_content {
    display: block;
    float: left;
    width: 200px;
}

#user_right_content {
    display: block;
    float: left;
    width: 80%;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    border: 1px solid #949494;
    padding: 5px;    
    min-height: 200px;
    margin-left: 210px;
}
msaz87 is offline
Reply With Quote
View Public Profile
 
Old 08-08-2010, 07:23 PM Re: Div scaling with browser resize
Skilled Talker

Posts: 90
Trades: 0
Figured it out... just had to take one float off and reorder some stuff... but thanks to everyone for the help!

Code:
#user_left_content {
    width: 200px;
    float: left;
}

#user_right_content {
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    border: 1px solid #949494;
    padding: 5px;    
    min-height: 200px;
    margin-left: 210px;
}
msaz87 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Div scaling with browser resize
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.45443 seconds with 12 queries