個人練習用、h2装飾(上下に短い線)
beforeとafter要素を使った装飾です。
解説なしです。個人練習用に作りました。
関連タイピング
-
解説付きでbox-shadowの基本をまとめています。
プレイ回数343 長文315打 -
簡単な解説付きでグラデーションをまとめ、個人練習用
プレイ回数558 長文645打 -
自作のハンバーガーメニューを作成しましょう!
プレイ回数4446 英語長文721打 -
HTML5とCSS3を学ぼう
プレイ回数2.7万 長文869打 -
TLJ専用のHTML練習用タイピングです。
プレイ回数4882 260打 -
CSSでよく使うプロパティのタイピング
プレイ回数562 英語長文584打 -
個人練習用のコードです
プレイ回数953 英語長文1787打 -
プレイ回数598 長文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; }