回答編集履歴
1
コード追記
answer
CHANGED
@@ -1,1 +1,29 @@
|
|
1
|
-
自分がやるなら、疑似要素で少し小さめのボックスを生成して、それに角丸ボーダーを付けるかな。
|
1
|
+
自分がやるなら、疑似要素で少し小さめのボックスを生成して、それに角丸ボーダーを付けるかな。
|
2
|
+
|
3
|
+
```html
|
4
|
+
<div class="btn">ボタン</div>
|
5
|
+
```
|
6
|
+
|
7
|
+
```css
|
8
|
+
div.btn {
|
9
|
+
background-color: cornflowerblue;
|
10
|
+
width: 200px;
|
11
|
+
font-size: 30px;
|
12
|
+
color: white;
|
13
|
+
text-align: center;
|
14
|
+
padding: 10px;
|
15
|
+
border-radius: 50px;
|
16
|
+
position: relative;
|
17
|
+
}
|
18
|
+
div.btn::before {
|
19
|
+
content: "";
|
20
|
+
position: absolute;
|
21
|
+
display: block;
|
22
|
+
top: 6px;
|
23
|
+
bottom: 6px;
|
24
|
+
left: 6px;
|
25
|
+
right: 6px;
|
26
|
+
border: 2px solid white;
|
27
|
+
border-radius: 50px;
|
28
|
+
}
|
29
|
+
```
|