Help us understand the problem. What is going on with this article?

IEでtableのborderが消えた話

More than 3 years have passed since last update.

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

T_sa
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした