Simple help on vertical alignment in table cell

时间:2016-07-11 19:05:42

标签: html alignment html-table vertical-alignment

I can't seem to get the vertical alignment correctly.

I thought maybe I had to specify the table-cell dimension, but that doesn't seem to work..

More specifically, I am referring to the characters inside each table-cell

http://codepen.io/neotriz/pen/yJPLOO

body {
  background: skyblue; }

#tictactoe {
  max-width: 700px;
  min-height: 300px;
  margin: 120px auto; }
  #tictactoe table {
    width: 100%;
    font-size: 100px;
    text-align: center;
    vertical-align: middle; }

td {
  color: #101935;
  background: #F2FDFF;
  border: 5px solid #DBCBD8;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.5s ease-out, color 0.5s ease-out; }

td:hover {
  background: #564787;
  color: white; }
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>TicTacToe FCC</title>
</head>
  <body>
    <div id="tictactoe">
      <table id="game-board">
        <tbody>
          <tr id="row1">
            <td>x</td>
            <td>x</td>
            <td>x</td>
          </tr>
          <tr id="row2">
            <td>x</td>
            <td>x</td>
            <td>x</td>
          </tr>
          <tr id="row3">
            <td>x</td>
            <td>o</td>
            <td>x</td>
          </tr>
        </tbody>
      </table>
    </div>
  </body>
</html>

Any inputs will be greatly appreciated

0 个答案:

没有答案