LoginSignup
18
9

More than 5 years have passed since last update.

td 要素の内側に border を引きたい

Posted at

方法

box-shadow を使う。

td.checked {
  box-shadow: 0 0 0 8px #e89a00 inset;
}

border だとはみ出てしまう。box-sizing: border-box; を指定しても結果は同じ。

td.checked {
  border: solid 8px #e89a00; /* うまくいかない…。 */
}

anime01.gif

デモ

See the Pen inner borders in table cells by QUANON (@quanon) on CodePen.

18
9
0

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
18
9