Generating HTML tags

HTML tags are created by the mere mention of their names in the view file. If you would like to include any text within a tag, include it right after the tag name.

The way tags work in Jade is best understood by looking at these examples:

Jade

HTML

html

<html></html>

div

<div></div>

div Hello World!

<div>Hello World!</div>

br

<br>

script

<script></script>

span Howdy?

<span>Howdy?</span>

It is important to note that it is your responsibility to use valid HTML tag names, Jade will just create an element—valid or not.

Hierarchy of HTML elements

In HTML, we create hierarchical DOM elements by nesting elements within other elements with the use of opening and closing tags. In Jade, we create hierarchy ...

Get Express Web Application Development now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.