html中心定位两个div

时间:2015-06-27 16:26:24

标签: html html5 dom

有没有更好的方法将表格放在中间位置?

代码:https://jsfiddle.net/k1d799fb/

#layout {
  display: table;
  margin: 40px auto;
}

#tetrisfield, #nextstone {
  border-collapse: separate;
  border: 10px solid gray;
}

#nextstone {
    margin-bottom: 150px;
}

html,body {
  margin: 0px;
  height: 100%;
  color: white;
  background-color: black;
  text-align: center;
}

#tetrisfield td, #nextstone td {
    width: 23px;
    height: 23px;
    background-color: rgba(255, 255, 255, 0.1);
}

目前我将表插入另一个居中的表中。 我的问题是 - 如果我使用位置相对或绝对,并希望调整窗口大小,表格重叠。

0 个答案:

没有答案
相关问题