首页htmlmediaCSS Layout - 如何根据屏幕尺寸调整div位置

CSS Layout - 如何根据屏幕尺寸调整div位置

我们想知道如何根据屏幕尺寸调整div位置。

<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
#left {
  background: #f00;
  height: 200px;
}

#right {
  overflow: hidden;
  background: #0f0;
  height: 200px;
}

@media all and (min-width:600px) {
  #left {
    float: left;
    width: 180px;
  }
  #right {
    margin-left: 180px;
  }
}
</style>
</head>
<body>
  <div>
    <div id="left">Nav</div>
    <div id="right">This is the space I need to fill but not go
      underneath the nav div</div>
  </div>
</body>
</html>