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

      <bdo id='0mtiS'></bdo><ul id='0mtiS'></ul>

    <small id='0mtiS'></small><noframes id='0mtiS'>

      1. 如何为居中的浮动确认对话框设计 CSS?

        时间:2023-09-04
        <tfoot id='YLM45'></tfoot>

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

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

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

                  本文介绍了如何为居中的浮动确认对话框设计 CSS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我正在寻找一种方法来显示始终位于页面中心并浮动在页面上的确认对话框.

                  I'm looking for a way to display a confirm dialog that's always centered on the page, and floating over the page.

                  试过了,但它根本不是始终居中",因为位置是固定的:

                  Tried that, but it's not 'always centered' at all, since the position is fixed:

                  .Popup
                  {
                      text-align:center;
                      position: absolute;
                      bottom: 10%;
                      left: 27%;
                      z-index:50;
                      width: 400px;
                      background-color: #FFF6BD;
                      border:2px solid black;
                  }
                  

                  有什么想法吗?谢谢

                  推荐答案

                  试试这个CSS

                  #centerpoint {
                      top: 50%;
                      left: 50%;
                      position: absolute;
                  }
                  
                  #dialog {
                      position: relative;
                  
                      width: 600px;
                      margin-left: -300px;
                  
                      height: 400px;
                      margin-top: -200px;
                  }
                  

                  <div id="centerpoint">
                      <div id="dialog"></div>
                  </div>
                  

                  #centerpoint应该是对话框的容器div

                  #centerpoint should be the container div of the dialog

                  注意 #centerpoint DIV 应该在 body 元素内或在没有 的元素内>位置:相对;属性

                  Note that the #centerpoint DIV should be inside the body element or inside elements that don't have a position: relative; property

                  这篇关于如何为居中的浮动确认对话框设计 CSS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:Angularjs - 当确认对话框为假时如何取消下拉更改 下一篇:如何从 javascript 打开 jQuery Mobile 对话框?

                  相关文章

                  最新文章

                  • <bdo id='D5fjf'></bdo><ul id='D5fjf'></ul>

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

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

                    <tfoot id='D5fjf'></tfoot>
                    <legend id='D5fjf'><style id='D5fjf'><dir id='D5fjf'><q id='D5fjf'></q></dir></style></legend>