html5とCSS3による装飾サンプル
html5とCSS3のサンプルの実用的なものがたくさんあります。
その一部をランダムに表示しています。 詳しくは サンプルページへどうぞ
-
>>タイトルに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; }
-
>>見出しを四角い枠で囲い淡い色を付ける 見出しの装飾
見出しを四角い枠で囲う
※ 見出しを四角い枠で囲い淡い色を付けグラデーションをかけます。
文字も白色で影をつけることにより刻印感をだします。[ 閉じる ]
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; }
-
>>背景の採色・模様 (9) - チェック柄 背景の装飾
背景の採色・模様
※ チェック柄の背景パターンです
[ 閉じる ]
htmlソース
<p class="background-ex13"> <span>背景の採色・模様</span> </p>
CSS
.background-ex13{ background-color: #9d5b8b; background-size: 10px 10px; background-image: linear-gradient(45deg, #d0af4c 25%, #d0af4c 25%, transparent 25%, transparent 75%, #d0af4c 75%, #d0af4c 75%), linear-gradient(-45deg, #d0af4c 25%, #d0af4c 25%, #d0af4c 25%, transparent 75%, #d0af4c 75%, #d0af4c 75%); color: #fff; font-size: 20px !important; font-weight: bold; height: 56px; width: 100%; padding: 0 !important; display: flex; align-items: center; border: solid 1px #aaa; } .background-ex13 span{ padding-left: 10px; }