teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

追記

2019/11/24 09:00

投稿

s8_chu
s8_chu

スコア14731

answer CHANGED
@@ -1,5 +1,10 @@
1
- `ins` 要素の終了タグがないことで、 `ins` 要素がセクション全体を囲んでいるからです。`ins` 要素にはユーザーエージェントスタイルシートによって `text-decoration: underline` が指定されており、これが子孫要素にまで影響しています。を修正ると下のようになります ([動作確認用リンク](https://jsfiddle.net/8p5Ldsz0/))
1
+ `ins` 要素の終了タグがないことで、 **`ins` 要素がセクション全体を囲んでいるから**です。`ins` 要素にはユーザーエージェントスタイルシートによって `text-decoration: underline` が指定されており、これが子孫要素にまで影響しています。`text-decoration` プロパティは**継承さませんが、その影響は子孫全体へ及び**ま。そのため質問文にあるように「どこにも線にするため指定がない」ように見えます。
2
2
 
3
+ > ## [§ 2. Line Decoration: Underline, Overline, and Strike-Through](https://drafts.csswg.org/css-text-decor-3/#line-decoration)
4
+ > When specified on or propagated to an inline box, that box becomes a decorating box for that decoration, applying the decoration to all its fragments. The decoration is then further propagated to any in-flow block-level boxes that split the inline (see CSS2.1 section 9.2.1.1). When specified on or propagated to a block container that establishes an inline formatting context, the decorations are propagated to an anonymous inline box that wraps all the in-flow inline-level children of the block container. When specified on or propagated to a ruby container, the decorations are propagated only to the ruby base. For all other box types, the decorations are propagated to all in-flow children.
5
+
6
+ これを修正すると、以下のようになります ([動作確認用リンク](https://jsfiddle.net/8p5Ldsz0/))。
7
+
3
8
  ```HTML
4
9
  <ins class="adsbygoogle"
5
10
  style="display:block"><h2><span class="ez-toc-section" id="i-4">ヒルドイドと同じ薬は市販で売っている</span></h2></ins>