Louie Adamian
Louie Adamian

Reputation: 83

Pug image as a link

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.

Upvotes: 8

Views: 9602

Answers (1)

user5085788
user5085788

Reputation:

This way (the indent is necessary):

a(href='https://github.com/LouieAdamian')
  img(src="/img/GitHub.png")

Upvotes: 20

Related Questions