使用 css 和 javascript/jquery,如何将我在页面下方垂直显示的图像居中?让我画个图。 这就是我的...
-------
| |
| |
-------
----------
| |
| |
----------
------
| |
| |
------
这就是我想要的
-------
| |
| |
-------
-----------
| |
| |
-----------
-----
| |
| |
-----
最佳答案
在居中图像类上设置以下 CSS:
display: block;
margin: 1em auto; /* the key here is auto on the left and right */
关于javascript - 如何动态居中图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10421992/