Jump to content

DIV; a set width/height then auto once surpasses set width? css help please.


Recommended Posts

Is there such a way that you could give a div a set width or height and then when that set width or height is reached make it auto from there.. \=

 

eg

#myepicdiv

{

width:250px;

width:auto;

height:250px;

height:auto;

}

 

When content surpasses 250pixels it then self sets the width/height to auto.

 

Is that possible?

probbaly the only one you need is min-height: since most websites grow only vertical.

 

so you can for instance do:

 

  div#wrapper{
       width:960px;
       min-height:550px; /*make a special stylesheet for IE 6 where are min-width's and min-heights are set to height
       margin: 0 auto; /*center the div */
       border: 1px dotted #ccc; /*just to show where it is */
}

 

good luck!

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.