html5とCSS3による装飾サンプル
html5とCSS3のサンプルの実用的なものがたくさんあります。
その一部をランダムに表示しています。 詳しくは サンプルページへどうぞ
-
>>背景の装飾 - 色塗 (1) 見出しの装飾
背景の装飾 色塗 (1)
※ 背景を色で塗ります。
[ 閉じる ]
htmlソース
<h4 class="background-ex4"> 背景の装飾 色塗 (1) </h4>
CSS
.background-ex4 { padding-left: 2rem !important; /* 本システムCSSの干渉を変更します */ background: linear-gradient(15deg, red 50%, yellow 50%); color: #fff; font-size: 20px !important; font-weight: normal; height: 56px !important; display: flex; align-items: center; }
-
>>見出しを下線で装飾する(2) 見出しの装飾
見出しを下線で装飾する 方法その(2)
※ h4タグ属性のボーダーに対して太さ色で装飾をする。 色のグラデーションは green → whiteと設定
linear-gradient( グラデーションの角度または方向, 開始色, 途中色, 終了色 )[ 閉じる ]
htmlソース
<h4 class="title-ex2"> 見出しを下線で装飾する 方法その(2) </h4>
CSS
.title-ex2 { padding: 0 0 8px 0 !important; /* 本システムCSSの干渉を変更します */ border-bottom: 16px solid; border-image: linear-gradient(to right, green 0%, #fff 100%); border-image-slice: 1; display: flex; align-items: flex-end !important; /* 下線に合わせるため */ line-height: 10px; color: #333; font-size: 20px !important; font-weight: normal; }
-
>>画像の操作(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); }