<!--margin:auto:是使块状元素居中对齐 text-align:一般使文本和内联图像(类似这样的)居中对齐(在ie中对块态元素设置也能达到居中对齐,但ff没效果) 2中特殊情况: ** positoin:absolute,position:fixed .text{position: absolute;width: 100px;height: 100px;right: 0;left: 0;top:0;bottom:0;margin: auto;} 水平居中:right:0; left:0; 垂直居中:top:0; bottom:0; position:absolute;元素向父级找position不为static的 position:fixed ;元素以浏览器的窗口为基准居中对齐; -->
margin:auto与text-align:center
最新推荐文章于 2024-06-12 12:14:48 发布