LoginSignup
11
8

More than 5 years have passed since last update.

IEでtableのborderが消えた話

Last updated at Posted at 2015-12-22

IEでtableのborderが消えた話

症状

  • table の td ないし th にbackground-color と border を一緒に設定すると、borderが見えなくなる。
  • しかし開発者ツールなどでbackground-colorを消してやるとborderが見えるようになる

参考コード

html
<table>
    <tbody>
        <tr>
            <th>見出し1</th>
            <th>見出し2</th>
        </tr>
        <tr>
            <td>内容1</td>
            <td>内容2</td>
        </tr>
    </tbody>
</table>
sample.scss(SCSS記法)
tr {
    th {
        background-color: #f00;
        border: 1px solid #000;
        color: #fff;
    }
    td {
        border: 1px solid #000;
    }
}

確認機種

  • IE9 - 11。
  • Firefox47(情報提供ありがとうございます!)

解決策

  • td ないし th に position: relative;がかかってないかを確認する。
  • かかってたら無効化すると治る。

別担当が *{position: relative;} とかやってくれてたおかげで引き起こされたようでした。
他の人に迷惑かけちゃダメ絶対。

参考:http://stackoverflow.com/questions/31030579/css-background-color-overlapses-with-border-on-table-cell-in-ie

11
8
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
8