Pug image as a link

為{幸葍}努か 提交于 2020-07-08 06:25:07

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!