Skip to content

Instantly share code, notes, and snippets.



Created Oct 20, 2020
What would you like to do?
var txt = $("img",this).attr("alt");
$(this).attr("data-label", txt);
<p class="sp_text"><img src="images/txt.png" alt="WebDesign Dackel" /></p>
/* スマホ時画像のalt属性をテキスト化 */
.sp_text:after {
content: attr(data-label);
.sp_text img {
display: none;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.