max-width

#main {
  max-width: 600px;
  margin: 0 auto; 
}

<div id="main">

Using max-width instead of width in this situation will improve the browser's handling of small windows. This is important when making a site usable on mobile. Resize this page to check it out!

By the way, max-width is supported by all major browsers including IE7+ so you shouldn't be afraid of using it.

posted @ 2013-10-08 15:07  sexy_girl  阅读(123)  评论(0编辑  收藏  举报