Jump to content

Resizeable Floats


crazygol4

Recommended Posts

Okay so I've tried to do some research on the topic and I find things that are close but not exact.  Here's the issue:

 

I have two divs that I want to be side-by-side...but I want the right div "sidebar" to have a static width (200px) and the left "maintextarea" to resize with the browser width (scaled on %).  I've even changed the sidebar to resize slightly based on %, but to no avail.  My attempts so far have produced either a page that floats properly, but maintextarea resorts to its min-width at all time, or I can get it to resize by removing float from maintextarea, but then sidebar isn't side-by-side with it.  So, Is this even possible to have a resizeable float?  If so, I could definately use Tips/Suggestion/Code plz  ;D

 

Here is my CSS for the divs:

 

#maintextarea {
float: left;
min-width: 660px;
max-width: 960px;
margin-right: 0px;
margin-left: 0px;
padding-left: 6px;
padding-top: 6px;
padding-right: 6px;
padding-bottom: 6px;
background-color:#666666;
}

#sidebar {
float: right;
margin-top: 0px;
margin-right: 0px;
margin-left: 0px;
min-width: 200px;
max-width: 29%;
background-color: #0033FF;
padding-top: 10px;
padding-left: 6px;
}

 

Thx for your help!

 

-crazygol4

Link to comment
Share on other sites

You REALLY need to learn the quick basics of floats.

Anyone can show you the solution to exactly what you are looking for, but it will only help you for THAT one circumstance.

 

Without understanding the basic concepts, you will soon get confused and frustrated when you add another element to your wireframe.

 

Here is an easy to follow online tutorial (all html)

 

Floatutorial

Link to comment
Share on other sites

Hey guy I appreciate the link, but I do have a fair understanding of floats.  I've never set a static right and expanding left float before.  The reason I posted on a forum is because I've spent time using what I currently have in front of me trying to achieve a result to no avail.  I'm trying to get this thing going because I really can't afford the hours of digging through floatology 101.  This could easily be a mistake in coding, and while I appreciate the fact that you want me to fully understand floats, I simply lack the time at this moment as I'm trying to get this site up quickly.

 

If you would like to offer some help, awesome!  If not that's cool too.  Thanks for your time to post.

 

-Crazygol4

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.