简体   繁体   中英

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' %}

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM