html5とCSS3による装飾サンプル
html5とCSS3のサンプルの実用的なものがたくさんあります。
その一部をランダムに表示しています。 詳しくは サンプルページへどうぞ
-
>>見出しの装飾 - 左右にラインを入れる 見出しの装飾
見出しの装飾 - 左右にラインを入れる
※ 背景色を利用して疑似的にラインを描画します。
[ 閉じる ]
htmlソース
<h4 class="background-ex5"> <span>見出しの装飾 - 左右にラインを入れる</span> </h4>
CSS
.background-ex5 { margin-top: 12px !important; /* 本システムCSSの干渉を変更します */ position: relative; color: #333; font-size: 20px !important; font-weight: normal; display: flex; align-items: center; justify-content: center; } .background-ex5 span { position: relative; z-index: 100; display: inline-block; margin: 0 2.5em; padding: 0 1em; background-color: #fff; text-align: left; } .background-ex5::before { position: absolute; top: 50%; z-index: 1; content: ''; display: block; width: 100%; height: 1px; background-color: red; /* 線の色 */ }
-
>>画像の操作(3) ロールオーバー
※ 画像にエフェクトをかけます。 filterプロパティで行います。
この例では背景画像に対し明度をとコントラストを上げ露光オーバーにし、さらにぼかしをかけています。
エフェクトはアニメーションで行っています。[ 閉じる ]
htmlソース
<p class="hover-ex7"> </p>
CSS
.hover-ex7 { height: 90px; width: 680px; box-sizing: border-box; background-image: url('/sysdata/images/sample/title_back1.png'); background-repeat: no-repeat; background-size: cover; background-position: center; transition: all .6s; } .hover-ex7:hover{ filter: contrast(150%) brightness(280%) blur(5px); }
-
>>見出しを四角い枠で囲い淡い色を付ける 見出しの装飾
見出しを四角い枠で囲う
※ 見出しを四角い枠で囲い淡い色を付けグラデーションをかけます。
文字も白色で影をつけることにより刻印感をだします。[ 閉じる ]
htmlソース
<h4 class="title-ex8"> 見出しを四角い枠で囲う </h4>
CSS
.title-ex8{ border: solid #ccc 1px; background: linear-gradient(to bottom, #fff 0%, #ddd 100%); text-shadow: 1px 1px 1px rgba(255, 255, 255, 1); color: #333; font-size: 20px !important; font-weight: normal; display: flex; align-items: center; height: 54px; padding-left: 12px; }