This is the source code for an HTML page containing a menu
HTML Code :
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.vertical-menu{
width: 200px;
}
.vertical-menu a{
background-color: #eee;
color: black;
display: block;
padding: 12px;
text-decoration: none;
}
.vertical-menu a:hover {
background-color: #ccc;
}
.vertical-menu a.active {
background-color: #04AA6D;
color: white;
}
</style>
</head>
<body>
<h1>Vertical Menu</h1>
<div class="vertical-menu">
<a href="#" class="active">Halaman Utama</a>
<a href="#">Halaman 1</a>
<a href="#">Halaman 2</a>
<a href="#">Halaman 3</a>
<a href="#">Halaman 4</a>
</div>
</body>
</html>
Python Code :
from flask import Flask, render_template, request
from jinja2 import Template, Environment, FileSystemLoader
aplikasi = Flask(__name__)
@aplikasi.route('/')
def tampilHalaman():
return render_template("halaman1.html")
if __name__ == '__main__':
aplikasi.run(host="0.0.0.0",port=8543,debug=True)
No comments:
Post a Comment