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; 这篇关于如何将绝对定位的元素与中心对齐?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!