個人練習用、h2装飾(上下に短い線)
beforeとafter要素を使った装飾です。
解説なしです。個人練習用に作りました。
関連タイピング
-
覚えたいCSS
プレイ回数518 長文147打 -
ワードプレスでよく使う分岐文です。
プレイ回数748 長文記号1049打 -
CSS1
プレイ回数514 長文英字1924打 -
2022.12.14:プロパティを削除・追加。
プレイ回数3232 英語90秒 -
CSSでよく使うプロパティのタイピング
プレイ回数454 英語長文584打 -
個人練習用で作りました。解説なしです。
プレイ回数1339 英語長文1140打 -
解説なし、個人練習用につくりました。
プレイ回数724 英語長文1054打 -
プレイ回数77 英字169打
問題文
ふりがな非表示
ふりがな表示
(h2{ position: relative; display: inline-block;)
h2{ position: relative; display: inline-block;
(margin-bottom: 1em; })
margin-bottom: 1em; }
(h2:before { content: ''; position: absolute;)
h2:before { content: ''; position: absolute;
(left: 50%; top: -15px; display: inline-block;)
left: 50%; top: -15px; display: inline-block;
(width: 60px; height: 5px;)
width: 60px; height: 5px;
(-webkit-transform: translateX(-50%);)
-webkit-transform: translateX(-50%);
(transform: translateX(-50%); background-color: black;)
transform: translateX(-50%); background-color: black;
(border-radius: 2px; })
border-radius: 2px; }
(h2:after { content: ''; position: absolute;)
h2:after { content: ''; position: absolute;
(left: 50%; bottom: -15px; display: inline-block;)
left: 50%; bottom: -15px; display: inline-block;
(width: 60px; height: 5px;)
width: 60px; height: 5px;
(-webkit-transform: translateX(-50%);)
-webkit-transform: translateX(-50%);
(transform: translateX(-50%);)
transform: translateX(-50%);
(background-color: black; border-radius: 2px; })
background-color: black; border-radius: 2px; }