html5とCSS3による装飾サンプル
html5とCSS3のサンプルの実用的なものがたくさんあります。
その一部をランダムに表示しています。 詳しくは サンプルページへどうぞ
-
>>タイトルにSVGでアイコンをつける(1) アイコンで装飾
タイトルにアイコンをつける(SVG-1)
※ タイトルにSVGでアイコンをつける。 このSVGはMITライセンスでの利用となります。
The MIT License (MIT) Copyright © 2019-2020 css.gg[ 閉じる ]
htmlソース
<h4 class="icon-ex3"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M12.0519 14.8285L13.4661 16.2427L17.7088 12L13.4661 7.7574L12.0519 9.17161L13.8804 11H6.34321V13H13.8803L12.0519 14.8285Z" fill="currentColor" /> <path fill-rule="evenodd" clip-rule="evenodd" d="M19.7782 19.7782C24.0739 15.4824 24.0739 8.51759 19.7782 4.22183C15.4824 -0.0739417 8.51759 -0.0739417 4.22183 4.22183C-0.0739417 8.51759 -0.0739417 15.4824 4.22183 19.7782C8.51759 24.0739 15.4824 24.0739 19.7782 19.7782ZM18.364 18.364C21.8787 14.8492 21.8787 9.15076 18.364 5.63604C14.8492 2.12132 9.15076 2.12132 5.63604 5.63604C2.12132 9.15076 2.12132 14.8492 5.63604 18.364C9.15076 21.8787 14.8492 21.8787 18.364 18.364Z" fill="currentColor" /> </svg> タイトルにアイコンをつける(SVG-1) </h4>
CSS
.icon-ex3{ font-size: 20px; font-weight: normal; color: #333; padding: 1rem; display: flex; align-items: center; height: 36px; } .icon-ex3 svg{ width: 24px; margin-right: 8px; margin-bottom: 4px; }
-
>>見出しを四角い枠で囲い淡い色を付ける 見出しの装飾
見出しを四角い枠で囲う
※ 見出しを四角い枠で囲い淡い色を付けグラデーションをかけます。
文字も白色で影をつけることにより刻印感をだします。[ 閉じる ]
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; }
-
>>見出しを四角い2重枠で囲う 見出しの装飾
見出しを四角い2重枠で囲う
※ 2重線を周りに引くのに outlineを利用する。
[ 閉じる ]
htmlソース
<h4 class="title-ex12"> 見出しを四角い2重枠で囲う </h4>
CSS
.title-ex12{ padding: 12px 20px !important; /* 本システムCSSの干渉を変更します */ color: #333; border: solid 1px #666; outline: solid 1px #666; outline-offset: -9px; color: #333; font-size: 20px !important; font-weight: normal; }