current position:Home>Pycharm HTML edit master page call

Pycharm HTML edit master page call

2022-02-03 01:59:43 CSDN Q & A

Master

<!DOCTYPE html><html lang="zh-CN"><head> <meta charset="UTF-8"> <title>Title</title> <link href="/static/css/bootstrap.css" rel="stylesheet"> <script src="/static/jquery-3.3.1.js"></script> <script src="/static/js/bootstrap.js"></script> <link rel="stylesheet" href="/static/css/base.css"></head><body><div class="base-div"> <ul class="list-inline"> <li><a class="base-p"> Linear algebra test paper generation system </a></li> <li> <button type="button" class="btn btn-primary" id="button-student"> Students log in </button> </li> <li> <button type="button" class="btn btn-primary" id="button-teacher"> Teachers log in </button> </li> <li> <button type="button" class="btn btn-primary" id="button-admin"> Administrator login </button> </li> <li class="message"> { 
    { student.name }}{ 
    { message }} </li> <li> <button type="button" class="btn btn-danger" id="lagout" > sign out </button> </li> </ul></div></body></html>

form Forms :

<!DOCTYPE html><html lang="zh-CN"><head> <meta charset="UTF-8"> <link rel="stylesheet" href="/static/css/bootstrap.css"> <link href="/static/css/base.css" rel="stylesheet"> <title> Students log in </title></head><body><div></div><div class="container" id="username" > <div class="row"> <div class="col-md-6 col-md-offset-3"> <form action="/studentlogin/" method="post" class="form-horizontal" role="form"> {% csrf_token %} <div class="form-group"> <label for="{ 
    { form_object.username.id_for_label}}" class="col-sm-2 control-label">{ 
    { form_object.username.label }}</label> <div class="col-sm-10"> { 
    { form_object.username }} <span id="helpBlock2" class="help-block"></span> </div> </div> </form> </div> </div></div><script src="/static/jquery-3.3.1.js"></script><script src="/static/js/bootstrap.js"></script></body></html>

I'd like to ask for some advice ,pycharm How to call your own template HTML To the new HTML page , I designed a navigation bar at the top HTML, I want to design something else HTML Keep the navigation bar at the top of the page




Refer to the answer 1:
<!DOCTYPE html><html lang="zh-CN"><head> <meta charset="UTF-8"> <link rel="stylesheet" href="/static/css/bootstrap.css"> <link href="/static/css/base.css" rel="stylesheet"> <title> Students log in </title></head><body><div><!-- Introduce the use of --><iframe src="./ Master .html" width="100%" height="50" frameborder="0"></iframe></div><div class="container" id="username" > <div class="row"> <div class="col-md-6 col-md-offset-3"> <form action="/studentlogin/" method="post" class="form-horizontal" role="form"> {% csrf_token %} <div class="form-group"> <label for="{ 
    { form_object.username.id_for_label}}" class="col-sm-2 control-label">{ 
    { form_object.username.label }}</label> <div class="col-sm-10"> { 
    { form_object.username }} <span id="helpBlock2" class="help-block"></span> </div> </div> </form> </div> </div></div> <script src="/static/jquery-3.3.1.js"></script><script src="/static/js/bootstrap.js"></script></body></html> 



Refer to the answer 2:



Refer to the answer 3:

use jQuery You can use load

<div id="header"></div>// js$('#header').load('header.html') //  Fill in your actual path 



Refer to the answer 4:

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.primo.wiki/2022/02/202202030159411806.html

Random recommended