<tfoot id='UuMCG'></tfoot>
      <i id='UuMCG'><tr id='UuMCG'><dt id='UuMCG'><q id='UuMCG'><span id='UuMCG'><b id='UuMCG'><form id='UuMCG'><ins id='UuMCG'></ins><ul id='UuMCG'></ul><sub id='UuMCG'></sub></form><legend id='UuMCG'></legend><bdo id='UuMCG'><pre id='UuMCG'><center id='UuMCG'></center></pre></bdo></b><th id='UuMCG'></th></span></q></dt></tr></i><div id='UuMCG'><tfoot id='UuMCG'></tfoot><dl id='UuMCG'><fieldset id='UuMCG'></fieldset></dl></div>
        <bdo id='UuMCG'></bdo><ul id='UuMCG'></ul>

    1. <small id='UuMCG'></small><noframes id='UuMCG'>

      1. <legend id='UuMCG'><style id='UuMCG'><dir id='UuMCG'><q id='UuMCG'></q></dir></style></legend>

      2. 如何使模式窗口在页面上居中?

        How to center a modal window on a page?(如何使模式窗口在页面上居中?)

          <i id='zxMHs'><tr id='zxMHs'><dt id='zxMHs'><q id='zxMHs'><span id='zxMHs'><b id='zxMHs'><form id='zxMHs'><ins id='zxMHs'></ins><ul id='zxMHs'></ul><sub id='zxMHs'></sub></form><legend id='zxMHs'></legend><bdo id='zxMHs'><pre id='zxMHs'><center id='zxMHs'></center></pre></bdo></b><th id='zxMHs'></th></span></q></dt></tr></i><div id='zxMHs'><tfoot id='zxMHs'></tfoot><dl id='zxMHs'><fieldset id='zxMHs'></fieldset></dl></div>
              <bdo id='zxMHs'></bdo><ul id='zxMHs'></ul>
              • <legend id='zxMHs'><style id='zxMHs'><dir id='zxMHs'><q id='zxMHs'></q></dir></style></legend>

                • <tfoot id='zxMHs'></tfoot>

                    <tbody id='zxMHs'></tbody>

                  <small id='zxMHs'></small><noframes id='zxMHs'>

                  本文介绍了如何使模式窗口在页面上居中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试在浏览器页面中居中模式窗口.我只是想把它居中,这样它就可以响应所有的屏幕.

                  I am trying center a modal window in the browser page. I just want to center it, so that it should be responsive for all the screens.

                  推荐答案

                  With position:absolute 假设你的modal是300x300

                  With position:absolute Assuming your modal is 300x300

                  .modal {
                     width: 300px;
                     height: 300px;
                     position: absolute;
                     left: 50%;
                     top: 50%; 
                     margin-left: -150px;
                     margin-top: -150px;
                  }
                  

                  使用 display:table 另一种方法是制作显示表

                  With display:table An alternative way for that is to make display table

                  <div class="modal">
                      <div class="body">
                          <div class="content">
                              Content goes here
                          </div>
                      </div>
                  </div>
                  <style>
                      .modal {display:table;}
                      .body {display:table-cell; vertical-align:middle; text-align:center;}
                  </style>
                  

                  这篇关于如何使模式窗口在页面上居中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  How to make rooftext effect and valley text effect in HTML5 (or Fabric.js)(如何在 HTML5(或 Fabric.js)中制作屋顶文字效果和山谷文字效果)
                  Draw border around nontransparent part of image on canvas(在画布上的图像不透明部分周围绘制边框)
                  dragging and resizing an image on html5 canvas(在 html5 画布上拖动图像并调整其大小)
                  What#39;s the difference between a boolean as primitive and a boolean as property of an object?(作为原始对象的布尔值和作为对象属性的布尔值有什么区别?)
                  I want to do animation of an object along a particular path(我想沿特定路径对对象进行动画处理)
                  How to upload image into HTML5 canvas(如何将图像上传到 HTML5 画布中)

                      <i id='4oOHL'><tr id='4oOHL'><dt id='4oOHL'><q id='4oOHL'><span id='4oOHL'><b id='4oOHL'><form id='4oOHL'><ins id='4oOHL'></ins><ul id='4oOHL'></ul><sub id='4oOHL'></sub></form><legend id='4oOHL'></legend><bdo id='4oOHL'><pre id='4oOHL'><center id='4oOHL'></center></pre></bdo></b><th id='4oOHL'></th></span></q></dt></tr></i><div id='4oOHL'><tfoot id='4oOHL'></tfoot><dl id='4oOHL'><fieldset id='4oOHL'></fieldset></dl></div>
                        <tbody id='4oOHL'></tbody>

                    1. <legend id='4oOHL'><style id='4oOHL'><dir id='4oOHL'><q id='4oOHL'></q></dir></style></legend>

                        <small id='4oOHL'></small><noframes id='4oOHL'>

                        <tfoot id='4oOHL'></tfoot>

                            <bdo id='4oOHL'></bdo><ul id='4oOHL'></ul>