【问题标题】:Why is my <table> behaving this way?为什么我的 <table> 会这样?
【发布时间】:2017-11-07 07:39:35
【问题描述】:

我遇到了两个 td 的内容彼此不一致的问题。我无法在小提琴中重现这一点:https://jsfiddle.net/5cyrtv2d/。很奇怪。

这是我的代码:

<tr>
      <td>
            <img src="images/Affiliations/aaa.logo_.color_.jpg" />
      </td>
      <td>
            <div class="contactContent">
                 AAA is a federation of 51 independently operated motor clubs throughout North America. AAA is a not-for-profit member service organization with more than 51 million members. They provide services to its members such as travel, automotive, insurance, financial, and discounts. AAA Approved Auto Repair facilities have been thoroughly inspected and are tested annually to ensure they meet – and often surpass – the stringent, demanding quality service criteria established by AAA.
            </div>
      </td>
</tr>

这是渲染的输出:

“contactContent”类与正在发生的事情无关 - 我删除了该类,它仍然像上面那样呈现。但是,当我用文本替换图像时,一切都符合我的预期。

【问题讨论】:

  • 能否在fiddle 中重现该问题?
  • @Lal 实际上我无法在小提琴中重现此内容,请参阅:jsfiddle.net/5cyrtv2d
  • 这是用什么渲染的?
  • 哦,你的小提琴似乎是正确的..所以我认为问题出在其他一些 css 上..你是否在页面中指定了任何其他 css?
  • @ShaunLoftin 我正在使用 Chrome。

标签: html html-table


【解决方案1】:

问题出在我的 reset.css 上。我有垂直对齐:基线;设置应用于我的表/单元格/行,这导致了问题。删除了它,现在一切正常。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-10-15
    • 1970-01-01
    • 2011-06-03
    • 2018-06-08
    • 2014-12-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多