回答編集履歴
1
コード修正
test
CHANGED
@@ -52,17 +52,7 @@
|
|
52
52
|
|
53
53
|
}
|
54
54
|
|
55
|
-
.title::before {
|
55
|
+
.title::before, .title::after {
|
56
|
-
|
57
|
-
content: url("https://placehold.jp/40x40.png");
|
58
|
-
|
59
|
-
width: 40px;
|
60
|
-
|
61
|
-
height: 40px;
|
62
|
-
|
63
|
-
}
|
64
|
-
|
65
|
-
.title::after {
|
66
56
|
|
67
57
|
content: url("https://placehold.jp/40x40.png");
|
68
58
|
|
@@ -73,3 +63,75 @@
|
|
73
63
|
}
|
74
64
|
|
75
65
|
```
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
現状のHTMLを変更しないなら、
|
70
|
+
|
71
|
+
`position: absolute;` で配置するといいでしょう。
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
```css
|
76
|
+
|
77
|
+
.title {
|
78
|
+
|
79
|
+
margin: 150px auto 75px auto;
|
80
|
+
|
81
|
+
text-align: center;
|
82
|
+
|
83
|
+
position: relative;
|
84
|
+
|
85
|
+
width: max-content;
|
86
|
+
|
87
|
+
padding: 0 40px;
|
88
|
+
|
89
|
+
}
|
90
|
+
|
91
|
+
.title span {
|
92
|
+
|
93
|
+
display: block;
|
94
|
+
|
95
|
+
}
|
96
|
+
|
97
|
+
h2 span {
|
98
|
+
|
99
|
+
font-size: 3rem;
|
100
|
+
|
101
|
+
}
|
102
|
+
|
103
|
+
h2 span.sub_title {
|
104
|
+
|
105
|
+
font-size: 1.1rem;
|
106
|
+
|
107
|
+
}
|
108
|
+
|
109
|
+
.title::before, .title::after {
|
110
|
+
|
111
|
+
content: url("https://placehold.jp/40x40.png");
|
112
|
+
|
113
|
+
width: 40px;
|
114
|
+
|
115
|
+
height: 40px;
|
116
|
+
|
117
|
+
position: absolute;
|
118
|
+
|
119
|
+
top: 50%;
|
120
|
+
|
121
|
+
transform: translatey(-50%)
|
122
|
+
|
123
|
+
}
|
124
|
+
|
125
|
+
.title::before {
|
126
|
+
|
127
|
+
left: 0;
|
128
|
+
|
129
|
+
}
|
130
|
+
|
131
|
+
.title::after {
|
132
|
+
|
133
|
+
right: 0;
|
134
|
+
|
135
|
+
}
|
136
|
+
|
137
|
+
```
|