Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > CSS tip needed; ensuring a minimum column width?

CSS tip needed; ensuring a minimum column width?
Thread Tools
Mac Elite
Join Date: Jan 2001
Location: Helsinki, Finland
Status: Offline
Reply With Quote
Feb 6, 2003, 11:44 AM
 
I'm working on a site lay-out, which I'd like to keep very simple and ascetic. I want the text to flow according to the window size, but prevent it from forming ridiculously narrow columns.

Easier shown than said - click here.

Everything is inside one DIV, while the IMG and P elements have margin and padding defined.

I've used CSS for styling for ages, but I'm a novice when it comes to any 'advanced' lay-out. Block, float and clear are giving me a headache... so any tips would be greatly appreciated!

J
     
Clinically Insane
Join Date: Nov 1999
Status: Offline
Reply With Quote
Feb 6, 2003, 12:53 PM
 
There is a min-width property which can be applied to elements; it works like the width element does except that it just specifies a minimum. Unfortunately, it's not very well-supported; Gecko can do it, and I think Opera and Safari can too, but guess who doesn't On browsers which don't support it, it doesn't do anything, so it won't hurt your layout in those browsers, however, neither will it help.
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
     
ism
Grizzled Veteran
Join Date: Sep 2001
Status: Offline
Reply With Quote
Feb 6, 2003, 01:46 PM
 
Judge_Fire, could you quite possibly be worrying over nothing? If you've got a nice fluid layout like that then if user X happens to get the page load with a 'nasty' narrow column that is difficult to read they can simply adjust the width of the viewing window. Even using a min-width property, it may prove tricky to avoid the narrow column at all font sizes the user may be viewing at.

But for more practical advice go to css-discuss.org and get the help of thousands of experts.

Ooh, I've just found a bit more info. There is a min-width javascript hack to get IE to work. The proper link is http://www.doxdesk.com/software/js/minmax.html , but it's also available here as well: http://georg.editthispage.com/resour...gn/css/scripts

Having said all that, min width really isn't going to help with ONE div is it? It seems you need a less than or greater than width property which doesn't exist. If I was you I'd give up and have a beer or something instead. I think what you have is "Satisficed" solution
(Last edited by ism; Feb 6, 2003 at 02:26 PM. )
     
Grizzled Veteran
Join Date: Jun 2001
Location: Melbourne, Australia
Status: Offline
Reply With Quote
Feb 6, 2003, 03:00 PM
 
Well, this may be a hack...

Why not insert a < div > that's (for example) 600px wide by 1px high within the enclosing < div > but before the image and the text. That way, because it's a block element, a wider window won't cause the text or image to reflow next to the < div > and a smaller window will only resize to 600px before you get the scrollbars.

Not the 'cleanest' CSS solution, but it will work.
Computer thez nohhh...
     
Mac Elite
Join Date: Jan 2001
Location: Helsinki, Finland
Status: Offline
Reply With Quote
Feb 6, 2003, 03:29 PM
 
Thanks for all the quick responses! I'll try out the various things and see what happens...

J
     
   
Thread Tools
Forum Links
Forum 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 On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 08:45 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2