div纯css自适应居中
web
2016-05-29

DIV纯CSS自适应居中

<!DOCTYPE html>
<html lang="zh-CN">
  <!--<![endif]-->
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>DIV纯CSS自适应居中[兼容IE7+ CHROME FF等]</title>
    <style type="text/css">
      .pop-wrap {
      position:fixed;
      top:0;
      background:rgba(0,0,0,.8);
      left:0;
      width:100%;
      height:100%;
      }
      .pop-wrap table {
      height:100%;
      width:100%;
      }
      .pop-wrap td {
      width:100%;
      height:100%;
      }
      div.pop {
      margin:0 auto;
      width:200px;
      background:#ECECEC;
      padding:20px;
      text-align:center;
      }
      div.pop p {
      font:200 14px/20px Microsoft YaHei;
      }
      div.pop input {
      background:#FFFFFF;
      border:1px solid #ADADAD;
      padding:3px 10px;
      border-radius:2px;
      cursor:pointer;
      }
    </style>
  </head>
  <body>
    &nbsp;

    fdsfsdfsadfsdafsdafdssad
    <div class="pop-wrap">
      <table>
        <tbody>
          <tr>
            <td>
              <div class="pop">

                感觉如何?

                <input type="button" value="确定" />

            </div></td>
          </tr>
        </tbody>
      </table>
    </div>
  </body>
</html>

其它文章