これはとっても助かったー><
画像タイトルがスマホだと小さかったりいろいろ問題があるのよねん。
data-属性はすべてのHTML要素につけることができ、値も自由につけることができる属性なのだそう。
data-*(*は半角英字の文字列)で指定する。
<h2 data-label="Title"><img src="画像.jpg" width="800" height="40" alt="Title"></h2>
h2::after{
display: inline-block;
content: attr(data-label); /*contentでdata-label属性を指定*/
padding-left: 6px;
border-left: solid 6px #0182c3;
colorその他font-sizeなど
}
h2 img{
display: none;
}
h2{
box-sizing: border-box;
padding: 5px 3px 2px;
border-bottom: solid 2px #0182c3;
}
助かったー!
参考URLです♪