View Full Version : Template Inheritance Using JavaScript

11-09-2012, 07:19 AM

I saw in Django framework , in there we can inherit the templates from common base.html.

In base.html all the common things are defined , And in other templates content of the pages are changed .

I just want define all common div's like header , footet and nav in base.html and extend this base.html in other pages with different content in page .

Thank You

11-09-2012, 03:20 PM
You write your main style sheet as an external file, lets say we name it basestyle.css and place it in the css folder. Now we can call it for every page we want to use it on like this:

<link href="http://www.somesite.org/css/basestyle.css" rel="stylesheet" type="text/css" /> Make it the first call and follow it with a call to the css file for that page.

This has nothing to do with javascript. It's just normal HTML/CSS.