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

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

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

        <legend id='HGeAa'><style id='HGeAa'><dir id='HGeAa'><q id='HGeAa'></q></dir></style></legend>

        如何将绝对定位的元素对齐到中心?

        How to align absolutely positioned element to center?(如何将绝对定位的元素对齐到中心?)
            <tbody id='1eM8O'></tbody>

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

            <small id='1eM8O'></small><noframes id='1eM8O'>

            <tfoot id='1eM8O'></tfoot>
            • <bdo id='1eM8O'></bdo><ul id='1eM8O'></ul>
                1. 本文介绍了如何将绝对定位的元素对齐到中心?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试将两个画布堆叠在一起并使其成为双层画布.

                  I am trying to stack two canvas together and make it a double layers canvas.

                  我在这里看到了一个例子:

                  I've saw an example here:

                  <div style="position: relative;">
                   <canvas id="layer1" width="100" height="100" 
                     style="position: absolute; left: 0; top: 0; z-index: 0;"></canvas>
                   <canvas id="layer2" width="100" height="100" 
                     style="position: absolute; left: 0; top: 0; z-index: 1;"></canvas>
                  </div>
                  

                  但我想将两个画布都设置在屏幕中心对齐.如果我将 left 的值设置为常量,而我更改屏幕的方向(就像我在 iPad 上做 aps 一样),画布不会像如何保持在屏幕中间它在

                  But i would like to set both of the canvas align at the center of the screen. If i set the value of left as a constant, while I change the orientation of the screen (as I'm doing aps on iPad) the canvas won't remain at the middle of the screen like how it act in

                  <div align="center">
                  

                  有人可以帮忙吗?

                  推荐答案

                  如果将左右两边都设置为零,左右边距设置为自动,则可以将绝对定位的元素居中.

                  If you set both left and right to zero, and left and right margins to auto you can center an absolutely positioned element.

                  position:absolute;
                  left:0;
                  right:0;
                  margin-left:auto;
                  margin-right:auto;
                  

                  这篇关于如何将绝对定位的元素对齐到中心?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  How does object-fit work with canvas element?(对象适合如何与画布元素一起使用?)
                  How to make rooftext effect and valley text effect in HTML5 (or Fabric.js)(如何在 HTML5(或 Fabric.js)中制作屋顶文字效果和山谷文字效果)
                  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?(作为原始对象的布尔值和作为对象属性的布尔值有什么区别?)
                  How to upload image into HTML5 canvas(如何将图像上传到 HTML5 画布中)
                  How to show a running progress bar while page is loading(如何在页面加载时显示正在运行的进度条)
                  <tfoot id='1Fc0U'></tfoot>
                2. <legend id='1Fc0U'><style id='1Fc0U'><dir id='1Fc0U'><q id='1Fc0U'></q></dir></style></legend>
                  <i id='1Fc0U'><tr id='1Fc0U'><dt id='1Fc0U'><q id='1Fc0U'><span id='1Fc0U'><b id='1Fc0U'><form id='1Fc0U'><ins id='1Fc0U'></ins><ul id='1Fc0U'></ul><sub id='1Fc0U'></sub></form><legend id='1Fc0U'></legend><bdo id='1Fc0U'><pre id='1Fc0U'><center id='1Fc0U'></center></pre></bdo></b><th id='1Fc0U'></th></span></q></dt></tr></i><div id='1Fc0U'><tfoot id='1Fc0U'></tfoot><dl id='1Fc0U'><fieldset id='1Fc0U'></fieldset></dl></div>

                    • <bdo id='1Fc0U'></bdo><ul id='1Fc0U'></ul>
                          <tbody id='1Fc0U'></tbody>

                          <small id='1Fc0U'></small><noframes id='1Fc0U'>