Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/87.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 导航菜单烧瓶_Python_Html_Python 3.x_Flask - Fatal编程技术网

Python 导航菜单烧瓶

Python 导航菜单烧瓶,python,html,python-3.x,flask,Python,Html,Python 3.x,Flask,我是个新手。我想在标题上方添加菜单栏,尽管这很难做到。这是为大学准备的,我花了很多时间在网上搜索烧瓶材料,这在网上不是很广泛。 需要帮忙吗 index.html页面 <html lang='en'> <meta charset="UTF-8"> <meta name="viewpoint" content="width=devide-width, initial-scale=1.0"> <meta http-equiv="X-U

我是个新手。我想在标题上方添加菜单栏,尽管这很难做到。这是为大学准备的,我花了很多时间在网上搜索烧瓶材料,这在网上不是很广泛。 需要帮忙吗

index.html页面

<html lang='en'>
    <meta charset="UTF-8">
    <meta name="viewpoint" content="width=devide-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/main1.css') }}">

<div id="menu">
      <strong>
            <nav>
                <ul class="menu">
                    <li><a href="{{ url_for('.index') }}">Home</a></li>
                    <li><a href="{{ url_for('.About') }}">About</a></li>
                    <li><a href="{{ url_for('.Analyses') }}">Analyses</a></li>
                    <li><a href="{{ url_for('.Contact') }}">Contact us</a></li>
                </ul>
            </nav>
        </strong>
    </div>



实际上,对于您的问题,与flask或python无关,它只是html。请使用此模板。本例使用bootstrap.customize来满足您的需要。干杯

<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
    <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
    <title>Hello world</title>
      <div class="jumbotron">
  <h1 >Welcome to  Page</h1>
</div>
  </head>
  <body>

    <nav class="navbar navbar-expand-lg navbar-light bg-light">

    <div class="navbar-nav">
      <a class="nav-item nav-link" href="#">Home</a>
      <a class="nav-item nav-link" href="#">Add Pup</a>
      <a class="nav-item nav-link" href="#">List of Pups</a>
      <a class="nav-item nav-link" href="#">Delete Pup</a>
      <a class="nav-item nav-link" href="#">Add Owner</a>
    </div>

</nav>
  </body>
</html>



你好,世界
欢迎来到第页
CSS文件中的输入

/* ==================================================== */
/* navigation */
/* ==================================================== */
nav ul{
    width: 98%;
    display: flex;
    flex-direction: row;
    text-align: center;
    margin: 0;
    padding: 0;
    list-style-type: none;
}
nav li {
    margin: 0;
    flex: 1 1 0%;
    color: #790b0b;
  }
nav a {
    background-color: #FF5C00;
    color: white;
    text-decoration: none;
    display: inline-block;
    width: 95%;
    margin: .5em 0;
    padding: .5em 1em;
    font-size: large;
    font-weight: normal;
}
nav a[aria-current="page"]{
    /*color: #55b517;*/
    text-decoration:underline;
    font-weight: bold;
}
nav a:active{
    color: #0d19a5;
    /*text-decoration:underline;*/
    /*font-weight: bold;*/
}
nav a:enabled {
    color: #691515;
    /*text-decoration:underline;*/
    /*font-weight: bold;*/
}
nav a:focus-visible {
    color: #691515;
    /*text-decoration:underline;*/
    /*font-weight: bold;*/
}

nav a:hover,
nav a:focus {
    background-color: #b74b2a;
}