回答編集履歴

1

先ほどは誤って途中確定した為、編集いたしました。

2018/03/13 03:52

投稿

退会済みユーザー
test CHANGED
@@ -1,5 +1,17 @@
1
- メニューの中身を直接編集
1
+ メニューの中身を直接編集するのではなく「before」疑似要素セレクタを使って挿入するのが良いかと思います。
2
2
 
3
- #sidebar h2::before { content:'\f146'; font-family:'Font Awesome 5 Pro'; color:#444; padding-right:4px; font-weight:400; }
3
+ ```
4
4
 
5
+ #allow_change h2::before { content:url(閉じた時の画像.png); }
6
+
5
- #sidebar h2.collapsed::before { content:'\f0fe'; }
7
+ #allow_change h2.collapsed::before { content:url(開いた時の画像.png); }
8
+
9
+ ```
10
+
11
+ ※「:before」でも「::before」でも動作しますが、css3では「::before」が推奨されています。
12
+
13
+
14
+
15
+ 詳細は以下をご覧ください。
16
+
17
+ https://developer.mozilla.org/ja/docs/Web/CSS/::before