Flask大標題下設定小標題(再加一個線)【html Css】
阿新 • • 發佈:2018-12-13
簡述
參考:
https://getbootstrap.com/docs/4.1/content/typography/
https://blog.csdn.net/think2me/article/details/7419028
核心程式碼
<h1>
Fancy display heading
<small class="text-muted">With faded secondary text</small>
</h1>
<div style ="height:1px; background:#E0E0E0;"></div>
完全程式碼
- templates/index.html
<!doctype html>
<html lang="zh">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" >
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"
integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<title>Hello, world!</title >
</head>
<body>
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<h3>
Fancy display heading
<small class="text-muted">With faded secondary text</small>
</h3>
<div style="height:1px; background:#E0E0E0;"></div>
<h2>
Fancy display heading
<small class="text-muted">With faded secondary text</small>
</h2>
<div style="height:1px; background:#E0E0E0;"></div>
<h1>
Fancy display heading
<small class="text-muted">With faded secondary text</small>
</h1>
<div style="height:1px; background:#E0E0E0;"></div>
</div>
</div>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"
integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49"
crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"
integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy"
crossorigin="anonymous"></script>
</body>
</html>
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
def hello_world():
return render_template('index.html')
if __name__ == '__main__':
app.run()
效果圖就是簡述上的。