Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jade Templates: Make an image a link

So in HTML i'd do something like this:

<a href="www.something.com">
    <img src="my/machine">
</a>

to make the image into a link. But I want to do the same for Jade. I was reading through the docs here but nothing relating to what I want. Help please? Thanks very much in advance.

like image 730
Giancarlo Manuel Guerra Salvá Avatar asked May 12 '15 15:05

Giancarlo Manuel Guerra Salvá


1 Answers

What you're doing is nesting elements. Nesting just requires new lines and a tab per nest level.

Jade:

a(href='www.something.com')
    img(src='my/machine')
like image 159
technophobia Avatar answered Oct 01 '22 18:10

technophobia