位置绝对图像对齐中心

时间:2013-06-12 13:45:58

标签: html css

我正在使用外部宽度为100%的图库。但是图像将左对齐,因为图库图像位置是绝对的。我试图让对齐的中心PLZ帮助我。

外部div css代码:

.wt-rotator .screen {
    height: 500px !important;
    left: -5px;
    position: relative;
    top: -11px;
    width: 100% !important;
}
图片css上的

样式:

.wt-rotator .main-img {
    border: 0 none;
    display: none;
    left: 0;
    padding: 0 !important;
    position: absolute;
    top: 0;
    z-index: 0;
}

感谢。

1 个答案:

答案 0 :(得分:0)

尝试添加css属性{left: 50%; right: 50%;}

相关问题