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
2 divs; 1 fixed 1 auto fill
Old 04-02-2008, 05:45 AM 2 divs; 1 fixed 1 auto fill
Junior Talker

Posts: 3
Trades: 0
Hi, I'm trying to create 2 divs next to each other with one being a fixed width while the other automatically fill the remaining space regardless of the browser size.

any help appreciated, thanks
out_kold is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-02-2008, 06:08 AM Re: 2 divs; 1 fixed 1 auto fill
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
HTML Code:
<div>
<div style="float:left;width:150px;>Fixed width on left</div>
Rest of text flows around it
</div>
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 04-02-2008, 06:23 AM Re: 2 divs; 1 fixed 1 auto fill
Junior Talker

Posts: 3
Trades: 0
thanks for your reply chrishirst, but what if i want to have the fixed div on the right and i want it to stick to the right wall while the left div fills the rest of the screen.

to clarify, what i'm trying to achieve is two boxes (divs) first box for "about" and to the right is the "sites update" box. The "site update" box would have fixed small width (~300px) and sticks all the way to the right, while the "about" box fill the rest of the screen to the left.

Thanks
out_kold is offline
Reply With Quote
View Public Profile
 
Old 04-02-2008, 06:26 AM Re: 2 divs; 1 fixed 1 auto fill
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
change "float:left;" to "float:right;"


<added>
And make sure you "break" the float after the container is closed.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?

Last edited by chrishirst; 04-02-2008 at 06:27 AM..
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 04-02-2008, 06:37 AM Re: 2 divs; 1 fixed 1 auto fill
Junior Talker

Posts: 3
Trades: 0
i tried that, but it doesn't work.

I don't know if it's against the rule here to post a link to a website, but the effect i'm looking for is something like this
http://www.forexpeacearmy.com

If it's against the rules I''ll edit it out.

Thanks
out_kold is offline
Reply With Quote
View Public Profile
 
Old 04-02-2008, 11:29 AM Re: 2 divs; 1 fixed 1 auto fill
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
It's not against the rules to post a link like that.

If what Chris gave you didn't work, then there's likely something else in your code. We'll need to see ALL the code to help you further.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 04-02-2008, 03:16 PM Re: 2 divs; 1 fixed 1 auto fill
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
I took a quick look at the site you gave as an example, and it looks as if there is one div sitting in the margin of the other one. However, this layout seems a bit complicated, and there are many solutions to this problem. Here is one writeup that may help: http://www.alistapart.com/articles/holygrail ... It is about building a liquid layout with two fixed-width sidebars. I'm sure you can figure out how to make it only one sidebar.
__________________
Join me on
Please login or register to view this content. Registration is FREE

Last edited by wayfarer07; 04-02-2008 at 03:18 PM..
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 04-02-2008, 03:22 PM Re: 2 divs; 1 fixed 1 auto fill
Gilligan's Avatar
Website Designer

Posts: 1,670
Name: Stefan
Location: London, UK
Trades: 0
why not just have two floats?

Code:
<div style="float:left; width:900px;">Left side</div>

<div style="float:right; width:200px;">Right side</div>

<br style="clear:both;" />
__________________

Please login or register to view this content. Registration is FREE
Gilligan is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to 2 divs; 1 fixed 1 auto fill
 

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.89036 seconds with 12 queries