html5とCSS3による装飾サンプル
html5とCSS3のサンプルの実用的なものがたくさんあります。
その一部をランダムに表示しています。 詳しくは サンプルページへどうぞ
-
>>タイトルにアイコンをつける (border-3) アイコンで装飾
タイトルにアイコンをつける
※ CSSでボーダーを変形させてアイコンを作成しています。
borderの角の描画特性を利用したアイコンです。 画像を用意しなくて良いので便利ではあります。[ 閉じる ]
htmlソース
<h4 class="icon-ex10"> タイトルにアイコンをつける </h4>
CSS
.icon-ex10{ font-size: 20px; display: flex; align-items: center; height: 36px; } .icon-ex10::before { content: ''; box-sizing: border-box; width: 8px; height: 8px; border: 8px solid transparent; border-left: 8px solid pink; }
-
>>見出しの装飾 角丸枠をつける 見出しの装飾
見出しに角丸の枠
※ 見出しに角丸の枠をつけます。
[ 閉じる ]
htmlソース
<h4 class="title-ex5"> 見出しに角丸の枠 </h4>
CSS
.title-ex5 { padding: 10px 10px 10px 18px !important; /* 本システムCSSの干渉を変更します */ border: solid 3px lightgray; border-radius: 0.5em; color: #333; font-size: 20px !important; font-weight: normal; display: flex; align-items: center; }
-
>>画像の操作(2) ロールオーバー
※ 画像にエフェクトをかけます。 filterプロパティで行います。
この例では背景画像に対し ポジ・ネガ反転します。
エフェクトはアニメーションで行っています。[ 閉じる ]
htmlソース
<p class="hover-ex6"> </p>
CSS
.hover-ex6 { 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-ex6:hover{ filter: invert(200%); }