Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jul 2012
    Posts
    15
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Template Inheritance Using JavaScript

    Hi,

    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

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,719
    Thanks
    25
    Thanked 662 Times in 661 Posts
    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:
    Code:
    <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.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •