Jacob Paris
← Back to all content

Optional closing elements in HTML

Several HTML elements do not require closing tags

  • <html>
  • <head>
  • <body>
  • <p>
  • <dt>
  • <dd>
  • <li>
  • <option>
  • <th>
  • <tbody>
  • <tr>
  • <td>
  • <tfoot>
  • <colgroup>

That means that this is valid html

<title>My blog</title>
<h1>My blog</h1>
<p>Welcome to my blog</p>
<p>Here are a list of my posts</p>
<li>My first post</li>
<li>My second post</li>
<li>My third post</li>

As a general rule I don't recommend writing html like this, as it can be hard to tell when an element is meant to end or meant to nest, especially when the formatting isn't as clean as possible.

Professional headshot

Hey there! I'm a developer, designer, and digital nomad building cool things with Remix, and I'm also writing Moulton, the Remix Community Newsletter

About once per month, I send an email with:

  • New guides and tutorials
  • Upcoming talks, meetups, and events
  • Cool new libraries and packages
  • What's new in the latest versions of Remix

Stay up to date with everything in the Remix community by entering your email below.

Unsubscribe at any time.