App下載
首頁htmlthree_columnCSS Layout - 如何使3列布局填充100%寬度

CSS Layout - 如何使3列布局填充100%寬度

我們想知道如何使3列布局填充100%寬度。

<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
#div1 {
  width: 29.6%;
  border: solid 1px #000;
  float: left;
}

#div2 {
  border: solid 1px #000;
  float: left;
  width: 39.6%
}

#div3 {
  width: 29.6%;
  border: solid 1px #000;
  float: right;
}

#Button1 {
  width: 100%
}

#Button2 {
  width: 100%
}

#Button3 {
  width: 100%
}
</style>
</head>
<body>
  <div id="div1">
    <button id="Button1">Button 1</button>
  </div>
  <div id="div2">
    <button id="Button2">Button 2</button>
  </div>
  <div id="div3">
    <button id="Button3">Button 3</button>
  </div>
</body>
</html>