html5とCSS3による装飾サンプル
html5とCSS3のサンプルの実用的なものがたくさんあります。
その一部をランダムに表示しています。 詳しくは サンプルページへどうぞ
-
[ 閉じる ]
htmlソース
<p class="hover-ex4"> <a href="#">サンプルテキスト</a> </p>
CSS
.hover-ex4 a { display: block; width: 160px; position: relative; color: #333; line-height: 1.5; font-size: 20px; font-weight: normal; text-decoration: none; } .hover-ex4 a::before, .hover-ex4 a::after { border-bottom: solid 2px #333; bottom: 0; content: ""; display: block; position: absolute; transition: all 0.3s ease 0s; width: 0%; } .hover-ex4 a::before { left: 50%; } .hover-ex4 a::after { right: 50%; } .hover-ex4 a:hover::before, .hover-ex4 a:hover::after { width: 50%; }
-
>>見出しの装飾 - マーカーでひいたようなラインを入れる 見出しの装飾
見出しの装飾 - マーカーでひいたようなラインを入れる
※ 背景色を利用して文字の半分のみマーカーをひいたように色をつけます。
[ 閉じる ]
htmlソース
<h4 class="background-ex6"> <span>見出しの装飾 - マーカーでひいたようなラインを入れる</span> </h4>
CSS
.background-ex6 { background: linear-gradient(transparent 50%, #fffea4 0%); }
-
>>画像の操作(1) ロールオーバー
※ 画像にエフェクトをかけます。 filterプロパティで行います。
この例では背景画像に対し 透過度を40%にしてモノクロにしています。
エフェクトはアニメーションで行っています。[ 閉じる ]
htmlソース
<p class="hover-ex5"> </p>
CSS
.hover-ex5 { 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-ex5:hover{ filter: grayscale(100%) opacity(40%); }