Search code examples
htmldjangoextendsdoctype

When extending a base.html , is the <!DOCTYPE html> tag passed on aswell?


The title says it all.

Is the doctype of: (base.html)

<!DOCTYPE html>
<html lang="en">
  <head>
      <meta charset="UTF-8">

Passed on to (home.html)

{% extends 'base.html' %}

Or do I need to declare the doctype in all of my documents? like so:

<!DOCTYPE html>

{% extends 'base.html' %}

Solution

  • No, you don't need to add <!DOCTYPE html> once you haved declared in the base.html when you are extending from it.