我正在尝试创建一个具有登录表单的导航,菜单链接位于登录表单下方。
我想在导航中找到这两个。但是问题是输出只给了我一个水平。而且菜单链接不在登录表单的下方。
我想要登录表单下方的菜单链接。但这给了我错误的输出
CSS:
.nav-link {
font-size: 18px !important;
text-transform: uppercase !important;
font-weight: 600 !important;
}
.navbar-light .navbar-nav .nav-link {
color: #ffff !important;
}
#search { margin: auto; }
body {
overflow-x: hidden;
}
HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0,
maximum-scale=1, user-scalable=no">
<title></title>
<!-- favicon -->
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="theme-color" content="#ffffff">
<!-- /favicon -->
<link href="/realcss/bootstrap-4.1.3.min.css" type="text/css" rel="stylesheet">
<link href="/realcss/flag-icon.min.css" type="text/css" rel="stylesheet">
<link href="/realcss/fontawesome-all-5.3.min.css" type="text/css" rel="stylesheet">
<link href="/css/layout.css" type="text/css" rel="stylesheet">
</head>
<body>
<!-- navigation.tpl -->
<header>
<nav class="navbar navbar-expand-md navbar-light fixed-top bg-dark border-bottom" style="float: right;">
<a class="navbar-brand" href="#"><img class="logo" src="/images/logo/M.png" style="max-width: 400px;
max-height: 64px;" alt=""></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse justify-content-center" id="navbarCollapse">
<div id="search">
<form class="d-flex justify-content-center align-items-center form-inline my-2 my-lg-0">
<div class="col-auto pl-0">
<div class="input-group">
<div class="input-group-prepend">
<div class="input-group-text"><i class="fa fa-user"></i></div>
</div>
<input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Email Address">
</div>
</div>
<div class="col-auto pl-0">
<div class="input-group">
<div class="input-group-prepend">
<div class="input-group-text"><i class="fa fa-lock"></i></div>
</div>
<input type="password" class="form-control" id="inlineFormInputGroup" placeholder="Password">
</div>
</div>
<div class="col-auto pl-0 pr-0">
<button class="btn btn-primary my-2 my-sm-0" type="submit">Login</button>
</div>
</form>
</div>
<ul class="navbar-nav d-flex justify-content-center">
<li id="li-home" class="nav-item active">
<a id="link-home" class="nav-link" href="#">Home<span class="sr-only">(current)</span></a>
</li>
<li id="li-about" class="nav-item">
<a id="link-about" class="nav-link" href="#">Link</a>
</li>
<li id="li-team" class="nav-item">
<a id="link-team" class="nav-link" href="#">Link</a>
</li>
<li id="li-news" class="nav-item">
<a id="link-news" class="nav-link" href="#">Link</a>
</li>
<li id="li-contact" class="nav-item">
<a id="link-contact" class="nav-link" href="{{ route('promotion') }}">Promotion</a>
</li>
</ul>
</div>
</nav>
</header>
</body>