Book Image

Web Development with Jade

By : Sean Lang
Book Image

Web Development with Jade

By: Sean Lang

Overview of this book

Table of Contents (16 chapters)

Tags


Since Jade is indentation-based, there are no end tags, and there are no angle brackets (<, >) to surround tags, because those are lame and ugly. The name of the tag is all that you need, and it is the first text on the line. Consider the following example:

Jade

HTML

p
<p></p>

If we add another tag within the <p> block (as explained earlier), we can create a nested tag as follows:

Jade

HTML

p
  span
<p>
  <span></span>
</p>

Alternatively, without putting it in the <p> block, we can just create it in a way that it acts as a sibling, as follows:

Jade

HTML

p
span
<p></p>
<span></span>

Text and blocks of text

Tags are pretty boring if they don't have any content, so Jade gives us three ways of putting text in tags.

Text on the same line

You can put the text directly after the tag name (separated by a space) as follows:

Jade

HTML

p Hello Word!
<p>Hello Word!</p>

Text blocks

For large bodies of text, putting...