/book/base.html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>{{title}}</title> <style> .header { height: 50px; background-color: fuchsia;; } .content{ height:600px; } .footer{ height:50px; background-color: thistle; } </style> </head> <body> <div class="header">Nav Area</div> <div class="content"></div> <div class="footer">Foot Area</div> </body> </html>
/book/index.html(注意路径)
{% extends 'base.html'%}
此时我们仍然可以得到