我有一个图像 – 加载图像.
我写的代码是:
img.loading { position:absolute; left:0px; top:0px; z-index:1; }
解决方法@H_502_13@
发现这个:
How to Center an Image Perfectly in CSS,可能有帮助.
#img
{
position:absolute;
width:592px; /*image width */
height:512px; /*image height */
left:50%;
top:50%;
margin-left:-296px; /*image width/2 */
margin-top:-256px; /*image height/2 */
}
#img { position:absolute; width:592px; /*image width */ height:512px; /*image height */ left:50%; top:50%; margin-left:-296px; /*image width/2 */ margin-top:-256px; /*image height/2 */ }