html5とCSS3による装飾サンプル
html5とCSS3のサンプルの実用的なものがたくさんあります。
その一部をランダムに表示しています。 詳しくは サンプルページへどうぞ
-
>>文字色の変更 ロールオーバー
※ マウスオーバー時に文字色を変更し、下線を波線にする。
text-decoration-style: wavy の他に solid double dotted dashed がある。[ 閉じる ]
htmlソース
<p class="hover-ex1"> <a href="#">サンプルテキスト</a> </p>
CSS
.hover-ex1 a{ color: #333; text-decoration-line: none; } .hover-ex1 a:hover{ color: red; text-decoration-line: underline; text-decoration-style: wavy; }
-
>>タイトルにSVGでアイコンをつける(3) アイコンで装飾
タイトルにアイコンをつける(SVG-3)
※ タイトルにSVGでアイコンをつける。 このSVGはMITライセンスでの利用となります。
The MIT License (MIT) Copyright © 2019-2020 css.gg
他にもアイコンがいっぱいあります。 https://css.gg/[ 閉じる ]
htmlソース
<h4 class="icon-ex5"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M10.2426 16.3137L6 12.071L7.41421 10.6568L10.2426 13.4853L15.8995 7.8284L17.3137 9.24262L10.2426 16.3137Z" fill="currentColor" /><path fill-rule="evenodd" clip-rule="evenodd" d="M1 5C1 2.79086 2.79086 1 5 1H19C21.2091 1 23 2.79086 23 5V19C23 21.2091 21.2091 23 19 23H5C2.79086 23 1 21.2091 1 19V5ZM5 3H19C20.1046 3 21 3.89543 21 5V19C21 20.1046 20.1046 21 19 21H5C3.89543 21 3 20.1046 3 19V5C3 3.89543 3.89543 3 5 3Z" fill="currentColor" /> </svg> タイトルにアイコンをつける(SVG-3) </h4>
CSS
.icon-ex5{ font-size: 20px; font-weight: normal; color: #333; padding: 1rem; display: flex; align-items: center; height: 36px; } .icon-ex5 svg { width: 24px; margin-right: 8px; margin-bottom: 4px; }
-
>>見出しを下線で装飾する(3) 見出しの装飾
見出しを下線で装飾する 方法その(3)
※ テキストのbackground属性を利用して装飾する。
[ 閉じる ]
htmlソース
<p class="title-ex3"> 見出しを下線で装飾する 方法その(3) </p>
CSS
.title-ex3 { padding: 0 0 4px 0 !important; /* 本システムCSSの干渉を変更します */ background-image: linear-gradient(to right, green, white); background-repeat: no-repeat; background-size: 100% 32%; background-position: bottom; color: #333; height: 48px !important; font-size: 20px !important; font-weight: normal; }