<a> inside an image alt attribute? (using UniteGallery which diplays &#34;alt&#34; as the image title)

时间:2018-05-18 17:12:39

标签: html anchor alt

I'm not good enough in JavaScript/jQuery to make my own gallery or modify an existing one. I'm using UniteGallery script which provide a nice looking tiles style gallery.

The problem is that I wanted a link to be displayed when the image is zoomed. And the only diplayed text when the image is clicked on, is the alt attribute.

So I'm wondering if I can put an <a> tag inside the alt attribute of the image. I know it's not what alt attribute should be for, but W3C validator doesn't seem to mind about that.

<img alt="Image 1 Title <a class='button' href='project1.html' target='_blank'>More</a>"
src="img/gallery/thumbs/image1.png" data-image="img/gallery/image1HD.png" data-description="Image 1 Description"/>

Do you think that's ok? (I don't even know what the data-description is used for in unitegallery.) If you got any other solution, I'll be glad to read it.

0 个答案:

没有答案