個人練習用、h2装飾(上下に短い線)

関連タイピング
-
自作のハンバーガーメニューを作成しましょう!
プレイ回数3304英語長文721打 -
プレイ回数57英字169打
-
初心者向けです。
プレイ回数7228英語546打 -
2022.12.14:プロパティを削除・追加。
プレイ回数2895英語90秒 -
html の基本16色
プレイ回数629206打 -
vue Lifecycle Hooks
プレイ回数201英語157打 -
h2やh3のデザインのcssです。解説なしです。
プレイ回数325英語長文980打 -
プレイ回数547長文385打
問題文
(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; }