【问题标题】:position absolute Image Aligned Center位置绝对图像对齐中心
【发布时间】:2013-06-12 21:52:19
【问题描述】:

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

外部 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;
}

谢谢。

【问题讨论】:

  • 没有示例或代码就无法帮助...
  • 那你为什么不去掉 position:absolute 样式呢?
  • 那么横幅应该是正确的...查看代码

标签: html css


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 2013-05-27
    • 2013-08-15
    • 2010-11-19
    • 2017-09-27
    • 1970-01-01
    • 1970-01-01
    • 2014-10-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多