问题
how do you make an image a link in Pug I've tried
a(href='https://github.com/LouieAdamian') img(src="/img/GitHub.png")
and
img(src="/img/GitHub.png")
a(href='https://github.com/LouieAdamian')
and
a(href='https://github.com/LouieAdamian')
img(src="/img/GitHub.png")
none of these worked I ether ended up with the text img(src="/img/GitHub.png")
as the link or no link at all.
回答1:
This way (the indent is necessary):
a(href='https://github.com/LouieAdamian')
img(src="/img/GitHub.png")
来源:https://stackoverflow.com/questions/43641721/pug-image-as-a-link