html5とCSS3による装飾サンプル
html5とCSS3のサンプルの実用的なものがたくさんあります。
その一部をランダムに表示しています。 詳しくは サンプルページへどうぞ
-
>>タイトルにSVGでアイコンをつける(4) アイコンで装飾
タイトルにアイコンをつける(SVG-4)
※ タイトルにSVGでアイコンをつける。 このSVGはMITライセンスでの利用となります。
The MIT License (MIT) Copyright © 2019-2020 css.gg
他にもアイコンがいっぱいあります。 https://css.gg/[ 閉じる ]
htmlソース
<h4 class="icon-ex6"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11 14.5V16.5H13V14.5H15V12.5H13V10.5H11V12.5H9V14.5H11Z" fill="currentColor" /><path fill-rule="evenodd" clip-rule="evenodd" d="M4 1.5C2.89543 1.5 2 2.39543 2 3.5V4.5C2 4.55666 2.00236 4.61278 2.00698 4.66825C0.838141 5.07811 0 6.19118 0 7.5V19.5C0 21.1569 1.34315 22.5 3 22.5H21C22.6569 22.5 24 21.1569 24 19.5V7.5C24 5.84315 22.6569 4.5 21 4.5H11.874C11.4299 2.77477 9.86384 1.5 8 1.5H4ZM9.73244 4.5C9.38663 3.9022 8.74028 3.5 8 3.5H4V4.5H9.73244ZM3 6.5C2.44772 6.5 2 6.94772 2 7.5V19.5C2 20.0523 2.44772 20.5 3 20.5H21C21.5523 20.5 22 20.0523 22 19.5V7.5C22 6.94772 21.5523 6.5 21 6.5H3Z" fill="currentColor" /> </svg> タイトルにアイコンをつける(SVG-4) </h4>
CSS
.icon-ex6 { font-size: 20px; font-weight: normal; color: #333; padding: 1rem; display: flex; align-items: center; height: 36px; } .icon-ex6 svg { width: 24px; margin-right: 8px; margin-bottom: 4px; }
-
>>タイトルにSVGでアイコンをつける(2) アイコンで装飾
タイトルにアイコンをつける(SVG-2)
※ タイトルにSVGでアイコンをつける。 このSVGはMITライセンスでの利用となります。
The MIT License (MIT) Copyright © 2019-2020 css.gg[ 閉じる ]
htmlソース
<h4 class="icon-ex4"> <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.7087 12L13.4661 7.7574L12.0519 9.17161L13.8803 11H6.34318V13H13.8803L12.0519 14.8285Z" fill="currentColor" /><path fill-rule="evenodd" clip-rule="evenodd" d="M1 19C1 21.2091 2.79086 23 5 23H19C21.2091 23 23 21.2091 23 19V5C23 2.79086 21.2091 1 19 1H5C2.79086 1 1 2.79086 1 5V19ZM5 21H19C20.1046 21 21 20.1046 21 19V5C21 3.89543 20.1046 3 19 3H5C3.89543 3 3 3.89543 3 5V19C3 20.1046 3.89543 21 5 21Z" fill="currentColor" /> </svg> タイトルにアイコンをつける(SVG-2) </h4>
CSS
.icon-ex4{ font-size: 20px; font-weight: normal; color: #333; padding: 1rem; display: flex; align-items: center; height: 36px; } .icon-ex4 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; }