Not signed in (Sign In)

SkillShare - A place to discuss Web Standards and Web Design topics

Categories

Vanilla 1.1.5a is a product of Lussumo. More Information: Documentation, Community Support.

    •  
      CommentAuthorGustavs
    • CommentTimeDec 23rd 2005 edited
     permalink
    Well, I'm still new to CSS, but I wanted to know, what is the best way to make dynamic content? so that height gets bigger/smaller in matter of the text, but there is some minimal height.

    For now I have been using this CSS hack, but with it I can't get valid xhtml code, becouse the height option is written twice. :/

    What is the best way to do that and to have a valid code?

    #full {
    position: relative;
    width: 838px;
    min-height:419px;
    height:auto !important;
    height:419px;
    }
    •  
      CommentAuthormringlein
    • CommentTimeDec 23rd 2005 edited
     permalink
    You should just be able to do this (reverse the order and lose the !important):


    #full {
    position: relative;
    width: 838px;
    height: 419px;
    min-height: 419px;
    }
    •  
      CommentAuthormringlein
    • CommentTimeDec 23rd 2005 edited
     permalink
    I've also done this in the past, if you dont like my first suggestion:


    #full {
    position: relative;
    width: 838px;
    min-height: 419px;
    }
    * html #full{
    height: 419px;
    }
    • CommentAuthorspyyddir
    • CommentTimeDec 23rd 2005
     permalink
    I might not be understanding the question correctly but if you just want it to have a minimum height and expand past that with content you could use:

    #full {
    position: relative;
    width: 838px;
    min-height: 419px;
    }

    If you skip the height declaration it will by default expand. Oh, and this won't work in IE since it doesn't recognise the min-height property.
    •  
      CommentAuthormringlein
    • CommentTimeDec 23rd 2005
     permalink
    spyyddir -- That is why i include the height and min-height. You must put them in the correct order so you make all browsers happy, including IE.
    •  
      CommentAuthorGustavs
    • CommentTimeDec 23rd 2005
     permalink
    Yeah, I needed a one thats working with all of the browsers.
    • CommentAuthorspyyddir
    • CommentTimeDec 23rd 2005
     permalink
    Oh I see... sorry bout that.
    •  
      CommentAuthorJohnRiv
    • CommentTimeDec 27th 2005 edited
     permalink

    The best solution to this problem still needs some work...


    mringlein's first solution will result in the height always being 419px (apply a background color to the CSS and view it in a standards-compliant browser to see what I mean).


    mringlein's second solution uses the star html hack which should not be used anymore (see IEblog and Tantek Çelik)


    An article at 24 Ways recommends using a child selector to deal with IE issues, because previous versions of IE do not support it, and IE7 should. That of course assumes that IE7 will fix all the other CSS problems still present in IE6


    I'm not sure the web design community has settled on a definite solution to dealing with IE, and the debate will probably continue until at least the final version of IE7 is released.


    So for now, I guess go with the child selector solution. Anyone have a better idea?

Add your comments
    Username Password
  • Format comments as (Help)