Reputation: 196861
i have a div on a web page that basically acts as a panel container. i want it to:
how would i do this in css?
Upvotes: 1
Views: 588
Reputation: 80505
Try this:
#panel
{
/* Other styles */
min-width:1000px;
/*width:100%; - removed as it will create horizontal scrollbar if margin and padding aren't 0 as per Josh's comment.*/
}
However, you will problems with older browsers like IE6 which do not like the min-width
thingy in which case you will need to use JavaScript.
Upvotes: 1
Reputation: 277
try this
#panel {
min-width: 1000px;
diplay: block;
overflow: hidden; }
Upvotes: 1
Reputation: 3603
Assuming this item is a block element (i.e. "display: block"), it should scale automatically as wide as its containing element (in this case the browser window).
In CSS, just specify "min-width: 1000px." This will work in IE8+ and all modern browsers.
Upvotes: 3