Set minimum for the box width

webdesign

New member
Joined
Jul 5, 2012
Messages
234
Points
0
A very handy CSS command that exists is the min-width command, min-height, whereby you can specify the minimum width for any element. This can be especially useful to determine the minimum width for a page.

#container {
min-width: 600px;
width:expression(document.body.clientWidth < 600? "600px": "auto" );
}
<div id="container">
your content here
</div>
 

Noticed

New member
Joined
Aug 1, 2012
Messages
25
Points
0
Thanks for the tip, i've always just used min-width: __px; never the line under it.
 
Older threads
Replies
1
Views
2,479
Replies
1
Views
1,909
Replies
2
Views
2,458
Replies
4
Views
3,043
Replies
8
Views
5,981
Newer threads
Replies
5
Views
3,599
Replies
6
Views
2,524
Replies
1
Views
2,459
Replies
9
Views
9,813
Latest threads
Replies
0
Views
8
Replies
0
Views
13
Replies
0
Views
17
Replies
0
Views
15
Replies
0
Views
26
Recommended threads
Replies
6
Views
2,892
Replies
9
Views
2,503
Replies
15
Views
4,827
Replies
2
Views
5,283

Latest postsNew threads

Referral contests

Referral link for :

Sponsors

Latest Blog ArticlesMost Viewed Threads

Popular tags

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top