【问题标题】:CSS width not centering the imageCSS宽度不居中图像
【发布时间】:2013-01-16 22:00:25
【问题描述】:

我使用 wordpress 作为我的 CMS,并且使用了我选择的主题。主题在主页上显示了一个滑块(轮播),但占用了太多空间。我试图将宽度和高度编辑为 80%,但 UI 搞砸了。滑块未居中,或带有左右箭头的框架靠得更近。图像被粉碎。我需要为此设置正确的 css。

我尝试了以下

  1. 将宽度和高度修改为 80%
  2. 降低了 px 值,进一步搞砸了

下面我有代码的相关 css 和 html 部分。

<div id="slides">
  <div class="slides_container slide" style="overflow: hidden; position: relative; display: block;">
    <div class="slides_control" style="position: relative; width: 2736px; height: 480px; left: -912px;"><div style="position: absolute; top: 0px; left: 912px; z-index: 5;">
       <a href=""><img src="http://localhost/taxeeta/wp-content/uploads/2013/01/116.png?1358343444279" alt=""></a>
    </div>
    <div style="position: absolute; top: 0px; left: 912px; z-index: 0; display: none;">
       <a href=""><img src="http://localhost/taxeeta/wp-content/uploads/2013/01/215.png" alt=""></a>
    </div>
  </div>
</div>

CSS:

#slides {
 position: absolute;
 top: 15px;
 left: 0px;
 z-index: 100;
 width: 897px;
 margin-left: 14px;
}

.slides_container {
 width: 912px;
 margin: 0;
 padding: 0;
}

.slides_control {
 position: absolute;
 top: 15px;
 left: 0px;
 z-index: 100;
 width: 897px;
 margin-left: 14px;
}

【问题讨论】:

  • 只是问.. 你知道你的 html 有内联样式 css 吗?
  • 即使我这样做了,我也无法理解它。 html css 不是我的一杯茶 :)
  • 显然 HTML 和 CSS 都不是你能理解的。因为没有 HTML CSS 这样的东西,因为有 HTML 和 CSS。两杯茶,用你的语言表达。 ;)
  • 当然,罗伯特,我完全同意你的看法 :)

标签: html css wordpress


【解决方案1】:

你确定有修改 element-css 的 jo javascript 代码吗? 您是否将 slides 和 slides_control 的宽度更改为相同? (对不起,我不会写 cmets...)

【讨论】:

    猜你喜欢
    • 2016-02-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-02
    • 1970-01-01
    • 2023-03-14
    相关资源
    最近更新 更多