OutFront Forums
     Home    Register     Search      Help      Login    

Follow Us
On Facebook
On Twitter
RSS
Via Email

Recent Posts
Todays Posts
Most Active posts
Posts since last visit
My Recent Posts
Mark posts read

Sponsors
Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.
Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.
Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

 

Elastic layout with minimum/maximum width

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> Cascading Style Sheets and Accessibility >> Elastic layout with minimum/maximum width
Page: [1]
 
Starhugger

 

Posts: 631
Joined: 4/12/2005
From: Canada
Status: offline

 
Elastic layout with minimum/maximum width - 7/12/2008 22:17:02   
Hi everyone,

Is there such a thing as creating a CSS layout with a centered 3-column structure, where the outer columns are a fixed width and the middle column is elastic according to the user's browser window, but there is a maximum width to which it will expand and a minimum width to which it will contract?

In other words, if someone has one of those panoramic wide screens or a super high resolution, it would only expand to a maximum of, say, 900px (for the sake of argument). And if the user has a very low resolution screen setting, it would not shrink to less than, say, 400px (again, for the sake of argument). In between, the middle column would resize proportionately according to the screen size.

I would like to design a layout that is flexible, but I don't want to wind up with long one-line paragraphs in someone's cinemascope screen, nor with overlapping boxes and images in tiny screen sizes. I guess the minimum size could be accomplished with an empty gif or something, although it would be nice to be able to do it with CSS instead.

The closest I've seen is something that uses left and right side margins that are a percentage of the screen size, but I still wouldn't be able to know how wide the center column might go when I design the inside layout for all the bits. I'd rather know that there's a minimum and a maximum so that I have some idea of what it's going to look like and I can work around those parameters.

I haven't seen anything like this in my search travels, but I might have missed it. Thanks!

Starhugger

Tailslide

 

Posts: 6692
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: Elastic layout with minimum/maximum width - 7/13/2008 3:18:22   
Yep totally possible.

Personally I tend to either set the widths of columns in ems so that it all expands at the same rate or using percentages so that again you get the fluidity. I tend not to use a mix of fixed and fluid - just personal preference.

What I do in either case is give the containing div (that contains the lot) a min-width and a max-width and then just set the inner widths as percentages. This ensures that it won't expand past what you want it to. If I'm going for a fluid, full size layout then I also set a width for the container div (say 98%) but I'm safe in the knowledge that once it hits it's max-width (say 1200px) that it won't grow any wider so you don't end up with the long unreadable lines.

Now the slight fly in the ointment (of course) is IE6 which doesn't understand min/max-widths BUT that's fairly straight-forward to get around by using a conditional comment aimed at IE6 and under. You then feed it the following (obviously widths changed to suit):
body {width:expression( documentElement.clientWidth < 760 ? (documentElement.clientWidth == 0 ? (body.clientWidth < 760 ? "760" : "auto") : "760px") : "auto" );}
#container {width:expression( documentElement.clientWidth > 1200 ? (documentElement.clientWidth == 0 ? (body.clientWidth >1024 ? "1200" : "auto") : "1200px") : "auto" );}


What this does is basically force IE6 and under to have a min-width of 760px and a max width of 1200 in this case.

What I do for 3 columns is to have a container div with two divs within it, both floated left (to avoid an IE dropping div issue). The second floated div is the right-hand sidebar. Within the first floated div contains two more floated divs - the left hand sidebar and the main content. I find this technique easier to understand and implement that other perfectly valid techniques such as negative margins.

Have a look here: http://www.pmob.co.uk/ Paul has a load of 3 column techniques (many of which are negative margins) and is a real expert on the old CSS.


_____________________________

Little Blue Plane Web Design | Land Rover project

:)

(in reply to Starhugger)
Starhugger

 

Posts: 631
Joined: 4/12/2005
From: Canada
Status: offline

 
RE: Elastic layout with minimum/maximum width - 7/21/2008 0:07:39   
Hi Tailslide,

Yikes! I thought I had said thank you already, but apparently my brains got scrambled. :) If I'd ever heard of min-width and max-width before, I must have assumed they were compatible with very few browsers. I haven't seen them used or referred to by anyone, so it's curious why this hasn't been used more often by those making the Great Quest For The Ideal Internet Layout. :) Thanks for the IE-sick fix, too. I will definitely play around with these.

Thanks again for the help!

Starhugger


(in reply to Tailslide)
c1sissy

 

Posts: 5087
Joined: 7/20/2002
From: NJ
Status: offline

 
RE: Elastic layout with minimum/maximum width - 7/21/2008 7:49:15   
Hi Starhugger,

Here is an article that you might want to read.

And a couple more for you.

1. 9 timeless 3 column layout techniques

2. Equal 3 column layout

3. From Cross Browser.com's site

4. Green beast article on different layouts

5. CSS Tricks site

A great book to get is one called stylin' with css by Charles Wyke Smith. He goes into detail on layouts with min max widths, and is an excellent author and a terrific person. He has two books out on css, I would recomend the second issue. Though it might be good to have the first one as well since it is such a great read.

I hope that some of this information is helpful for you.

_____________________________

Deb-aka-c4Ksissy
high panjandurum and alpha female of the silverback tribe
As decreed by Jesper 5-24-2003.
The only stupid question is... the one that is never asked!!
http://directory.css-styling.com
http://fmsforum.com
http://positioniseverything.net/
http://www.tanfa.co.uk/

(in reply to Starhugger)
Starhugger

 

Posts: 631
Joined: 4/12/2005
From: Canada
Status: offline

 
RE: Elastic layout with minimum/maximum width - 7/21/2008 21:04:45   
Hi Deb,

Wow, thanks so much for these links and the book referral! I haven't come across these sites before in my search for CSS column techniques, and they look very helpful on first glance. I've got my homework cut out for me now. :)

Starhugger


(in reply to c1sissy)
c1sissy

 

Posts: 5087
Joined: 7/20/2002
From: NJ
Status: offline

 
RE: Elastic layout with minimum/maximum width - 7/22/2008 8:13:22   
Hi Starhugger,

Just become good friends with google, and you can find a wealth of information when you search. All I did to find information for you was to highlight terms in your post for information to find for you.

In regards to the book. I have all 3 of his books. He is one of those writers that can write a book like he is right there talking to you. He explains things really great.

He also has a book called codin for the web which is pretty good as well.

If you need anything else just let us know.:) And good luck with your reading!

_____________________________

Deb-aka-c4Ksissy
high panjandurum and alpha female of the silverback tribe
As decreed by Jesper 5-24-2003.
The only stupid question is... the one that is never asked!!
http://directory.css-styling.com
http://fmsforum.com
http://positioniseverything.net/
http://www.tanfa.co.uk/

(in reply to Starhugger)
Starhugger

 

Posts: 631
Joined: 4/12/2005
From: Canada
Status: offline

 
RE: Elastic layout with minimum/maximum width - 7/22/2008 19:14:41   

quote:

Just become good friends with google, and you can find a wealth of information when you search. All I did to find information for you was to highlight terms in your post for information to find for you.

Huh?? What do you mean "highlight terms?" What fresh magic is this?

Starhugger


(in reply to c1sissy)
c1sissy

 

Posts: 5087
Joined: 7/20/2002
From: NJ
Status: offline

 
RE: Elastic layout with minimum/maximum width - 7/24/2008 9:45:23   
Hi Starhugger,

Ok, you know how to right click and highlight things? Well do that and copy and paste into google, or if you have the Firefox extensions you can always highlight it and then right click and up comes the little box with all the information in it, and one of the options is to search google.

Both ways work really great.

If you have anymore questions please post them.

_____________________________

Deb-aka-c4Ksissy
high panjandurum and alpha female of the silverback tribe
As decreed by Jesper 5-24-2003.
The only stupid question is... the one that is never asked!!
http://directory.css-styling.com
http://fmsforum.com
http://positioniseverything.net/
http://www.tanfa.co.uk/

(in reply to Starhugger)
Starhugger

 

Posts: 631
Joined: 4/12/2005
From: Canada
Status: offline

 
RE: Elastic layout with minimum/maximum width - 7/24/2008 11:22:12   

quote:

...if you have the Firefox extensions you can always highlight it and then right click and up comes the little box with all the information in it, and one of the options is to search google.

Oh! I never knew that was there! Thanks! :)


SH

(in reply to c1sissy)
Page:   [1]

All Forums >> Web Development >> Cascading Style Sheets and Accessibility >> Elastic layout with minimum/maximum width
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts