Reply LinkBack Thread Tools Search this Thread
Old 03-07-2009, 10:08   #1 (permalink)
mudz
Senior Member
 
Join Date: Aug 2005
Posts: 155
Is this still a valid method to set min-height to an element?

hi, I have used this a couple of years ago but was wondering if it's still ok or there is a better, more recent "generally used" way of doing it.

Code:
#container { height: 180px; min-height: 180px; } html>body #container { height: auto; }
  Reply With Quote
Old 03-07-2009, 10:40   #2 (permalink)
pob
Senior Member
 
pob's Avatar
 
Join Date: Dec 2004
Location: Brighton
Posts: 1,044
Send a message via MSN to pob
  Reply With Quote
Old 03-07-2009, 10:42   #3 (permalink)
solarisedesign
Where's my snow?
 
solarisedesign's Avatar
 
Join Date: Aug 2008
Location: Edinburgh, UK
Posts: 801
Send a message via MSN to solarisedesign
I've always found min-heights and max-heights to be terribly unreliable. I don't think there's any "generally used" way of doing things, just whatever tends to be easiest and most effective.

My current way of doing this is floating a fixed height div to the left/right of any content

Code:
<!-- for a content element with a minimum height of 300px --> <div> <div style='float:left; height:300px;'></div> Content here. Blah blah blah </div>

Seems to work anyway. A bit messy but hey, gets the job done.

edit: actually, that possibly doesn't work - shall need to re-check that there...
  Reply With Quote
Old 03-07-2009, 10:45   #4 (permalink)
mudz
Senior Member
 
Join Date: Aug 2005
Posts: 155
  Reply With Quote
Old 03-07-2009, 10:47   #5 (permalink)
solarisedesign
Where's my snow?
 
solarisedesign's Avatar
 
Join Date: Aug 2008
Location: Edinburgh, UK
Posts: 801
Send a message via MSN to solarisedesign
Actually, think I was thinking of something completely different :P Ah well
  Reply With Quote
Old 03-07-2009, 15:04   #6 (permalink)
Sean McP
Registered User
 
Sean McP's Avatar
 
Join Date: Jul 2006
Location: USA
Posts: 79
Send a message via Skype™ to Sean McP
Yes, it is still valid.
  Reply With Quote
Old 03-07-2009, 16:22   #7 (permalink)
stugoo
Stugoo
 
stugoo's Avatar
 
Join Date: Jun 2009
Location: London
Posts: 26
yeah thats valid.

Personally I prefer to call a different CSS for ie6 (only 'modern' browser which doesn't support min-height). This allows me to keep my 'fixes' separate.

<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="ie6.css" />
<![endif]-->


so your the declaration would be
.element { min-height : 500px;}

and in the ie6 stylesheet would have:

.element { height:500px;}

I tend to mark my CSS with any ie6 fixes with comments such as /*ie6*/

The box model for ie6 is the only browser that expands to fit the content that is inside it which is why this method, i feel, is much better.

however its down to personal preference
  Reply With Quote
Old 03-07-2009, 16:55   #8 (permalink)
pob
Senior Member
 
pob's Avatar
 
Join Date: Dec 2004
Location: Brighton
Posts: 1,044
Send a message via MSN to pob
Quote:
Originally Posted by stugoo
yeah thats valid.

Personally I prefer to call a different CSS for ie6 (only 'modern' browser which doesn't support min-height). This allows me to keep my 'fixes' separate.

<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="ie6.css" />
<![endif]-->


so your the declaration would be
.element { min-height : 500px;}

and in the ie6 stylesheet would have:

.element { height:500px;}

I tend to mark my CSS with any ie6 fixes with comments such as /*ie6*/

The box model for ie6 is the only browser that expands to fit the content that is inside it which is why this method, i feel, is much better.

however its down to personal preference

you are right but ie6 is not a moden browser. its like 10 years old or somthing.

why are you marking you css with ie6 fix if you have a ie6 stylesheet? i personal like to keep anything to do with ie6 as far away from my main sheet as poss.

not pulling you apart just intrested.
  Reply With Quote
Old 15-07-2009, 09:27   #9 (permalink)
PartDigital
Freelance Web Developer
 
PartDigital's Avatar
 
Join Date: Oct 2007
Posts: 148
I use this in all my stylesheets when I set min-height. It fixes the min-height issue in ie6 so you don't have to create another css file.

Code:
min-height:600px; height:auto !important; height:600px;
  Reply With Quote
Old 05-08-2009, 00:36   #10 (permalink)
Walenty Belsha
Registered User
 
Join Date: Aug 2009
Posts: 19
The idea behind positioning is fairly simple. It allows you to define exactly where element boxes will appear relative to where they would ordinarily be or relative to a parent element, or another element, or even to the browser window itself. The power of this feature is both obvious and surprising.
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive
Web Hosting by Heart Internet, vBulletin © 2000-2009 Jelsoft Enterprises Limited.
Search Engine Optimization by vBSEO 3.0.0 RC8
Web Hosting by Heart Internet