Jinja Inheritance Sample

<!DOCTYPE html>
<html lang="en">
<head>
    {% block head %}
    <link rel="stylesheet" href="style.css" />
    <title>{% block title %}{% endblock %} - My Webpage</title>
    {% endblock %}
</head>
<body>
    <div id="content">{% block content %}{% endblock %}</div>
    <div id="footer">
        {% block footer %}
        © Copyright 2008 by <a href="http://domain.invalid/">you</a>.
        {% endblock %}
    </div>
</body>
</html>

3.5
6
Ramin 95 points

                                    {% extends &quot;base.html&quot; %}
{% block title %}Index{% endblock %}
{% block head %}
    {{ super() }}
    &lt;style type=&quot;text/css&quot;&gt;
        .important { color: #336699; }
    &lt;/style&gt;
{% endblock %}
{% block content %}
    &lt;h1&gt;Index&lt;/h1&gt;
    &lt;p class=&quot;important&quot;&gt;
      Welcome to my awesome homepage.
    &lt;/p&gt;
{% endblock %}

3.5 (6 Votes)
0
4
1

                                    {% extends &quot;layout.html&quot; %}
{% block title %}Index{% endblock %}
{% block head %}
  {{ super() }}
  &lt;style type=&quot;text/css&quot;&gt;
    .important { color: #336699; }
  &lt;/style&gt;
{% endblock %}
{% block content %}
  &lt;h1&gt;Index&lt;/h1&gt;
  &lt;p class=&quot;important&quot;&gt;
    Welcome on my awesome homepage.
{% endblock %}

4 (1 Votes)
0
Are there any code examples left?
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source