1 回答

TA貢獻(xiàn)1828條經(jīng)驗(yàn) 獲得超6個贊
bootstrap 4您可以在 jinja2 代碼中使用類。但為此你必須在 html 模板中添加 bootstrap 的 CSS。
我是這樣做的:
<!DOCTYPE html>
<html>
<head>
? ? <title>{{ title }}</title>
? ? <link rel="stylesheet" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
? ? <link rel="stylesheet">
</head>
<body>
? ? <style type="text/css">
? ? ? ? body{
? ? ? ? ? ? font-family: 'Montserrat', sans-serif;
? ? ? ? }
? ? </style>
? ? ? ?<form action="your route fucntion" method="POST">
? ? ? ? ? ? {{ form.hidden_tag() }}
? ? ? ? ? ? {{ form.name.label() }}
? ? ? ? ? ? {{ form.name(class="form-control pt-4") }}
? ? ? ? ? ? {{ form.email.label(class="pt-4") }}
? ? ? ? ? ? {{ form.email(class="form-control pt-4") }}
? ? ? ? ? ? {{ form.message.label(class="pt-4") }}
? ? ? ? ? ? {{ form.message(class="form-control pt-4") }}
? ? ? ? ? ? {{ form.submit(class="btn btn-outline-success ml-1 mt-5") }}
? ? ? ? </form>
? ? </div>
? ? <p class="text-info ml-5 pt-4">**All fields are required.</p>
</body>
</html>
- 1 回答
- 0 關(guān)注
- 122 瀏覽
添加回答
舉報