我的应用程序中有两个导航栏似乎不同步。即,这个:
我想让导航栏在徽标上折叠。
尝试在navbar-header类下部署此徽标。但面临着对齐问题。
我的代码 :
admin.html :
<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>MDM - Admin Suite</title>
<div th:replace="fragments/header :: header-css"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-smart-table/2.1.8/smart-table.min.js"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans" />
<link rel="stylesheet" type="text/css" href="webjars/bootstrap/3.3.7/css/bootstrap.min.css" />
<link rel="stylesheet" th:href="@{/css/main.css}" href="../../css/main.css" />
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
</head>
<body ng-app="uploadFileApp">
<div th:replace="fragments/header :: header"/>
<div class="sidebar">
<ul>
<li><a href="#" class="hvr-sweep-to-right">Home</a></li>
<li><a href="#" class="hvr-sweep-to-right">Service</a></li>
<li><a href="#" class="hvr-sweep-to-right">Portfolio</a></li>
<li><a href="#" class="hvr-sweep-to-right">About</a></li>
<li><a href="#" class="hvr-sweep-to-right">Contact</a></li>
</ul>
</div>
<div class="container uploadposition">
<div ng-controller="uploadFileController">
<form class="form-horizontal" id="uploadForm" action="#">
<div class="form-group">
<label class="control-label col-sm-2" for="uploadfile">Upload File:</label>
<div class="col-sm-5">
<input id="upload" class="form-control" type="file" file-model = "uploadedFile" placeholder="Upload File"></input>
</div>
<button type="submit" class="uploadButton" ng-click = "doUploadFile()">Upload</button>
</div>
</form>
<div class="col-sm-offset-2">
<p ng-bind="uploadResult"></p>
</div>
<hr/>
</div>
<div id="pas-table-div" style="display:none;">
<h3>PAS MDM Reject Records</h3>
<div ng-show="loading" >
<h3>Loading...</h3>
</div>
<div class="col-sm-offset-2">
<p ng-bind="submitResult"></p>
</div>
<table st-table="display_records" st-safe-src="employees" ng-init="getData()" ng-show="employees.length"
class="table table-striped" ng-controller="uploadFileController">
<thead>
<tr>
<th>Policy Number</th>
<th width="100px">First Name</th>
<th st-sort="salary">Last Name</th>
<th>Error Description</th>
<th>Validated/Corrected in PAS</th>
<th>Note</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr st-select-row="row" st-select-mode="multiple"
ng-repeat="row in display_records">
<td>{{row.PolicyNumber}}</td>
<td>{{row.FirstName}}</td>
<td>{{row.LastName}}</td>
<td>{{row.ErrorDescription}}</td>
<td>{{row.PASValidated}}</td>
<td>{{row.Note}}</td>
<td><button type="button" class="btn btn-danger" ng-click="deletRecord(row.PolicyNumber)">
<i class="glyphicon glyphicon-trash"> </i>
</button>
</td>
</tr>
<tr>
<td></td>
<td></td>
<td style="border-bottom: 1px solid #ddd;"></td>
<td style="border-bottom: 1px solid #ddd;">
<button type="button" class="submitButton" ng-click="submit(employees)">Submit</button>
</td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="5" class="text-center">
<div st-pagination="" st-items-by-page="itemsByPage"></div>
</td>
</tr>
</tfoot>
</table>
</div>
<script src="/js/jsaApp.js"></script>
<script src="/js/uploadFileCtrl.js"></script>
</div>
</body>
</html>
header.html中:
<html xmlns:th="http://www.thymeleaf.org">
<head>
<div th:fragment="header-css">
<!-- this is header-css -->
<link rel="stylesheet" type="text/css" href="webjars/bootstrap/3.3.7/css/bootstrap.min.css" />
<link rel="stylesheet" th:href="@{/css/main.css}" href="../../css/main.css" />
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
</div>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top" th:fragment="header">
<div class="container">
<div class="navbar-header">
<!-- <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".nav-collapse" aria-expanded="false">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button> -->
<a class="navbar-brand" href="#" th:href="@{/}"><img class="logoImg" height="25" width="55" src="http://static1.squarespace.com/static/56bcdc788259b5861e880ebe/t/5a96fae971c10bede98395de/1520548852981/?format=1500w"></img></a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li th:classappend="${module == 'tasks' ? 'active' : ''}">
<a href="#" th:href="@{/task}">Tasks</a>
</li>
<li th:classappend="${#httpServletRequest.getRequestURI() == '/dashboard' ? 'active':''}"><a th:href="@{/dashboard}"><span>Dashboard</span></a></li>
<li th:classappend="${#httpServletRequest.getRequestURI() == '/orders' ? 'active':''}"><a th:href="@{/orders}"><span>Orders</span></a></li>
<li th:classappend="${#httpServletRequest.getRequestURI() == '/income' ? 'active':''}"><a th:href="@{/income}"><span>Income</span></a></li>
<li role="separator" ></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li th:if="${#authorization.expression('!isAuthenticated()')}">
<a href="/signin" th:href="@{/signin}">
<span class="glyphicon glyphicon-log-in" aria-hidden="true"></span> Sign in
</a>
</li>
<li th:if="${#authorization.expression('isAuthenticated()')}">
<a href="/logout" th:href="@{#}" onclick="$('#form').submit();">
<span class="glyphicon glyphicon-log-out" aria-hidden="true"></span> Sign out
</a>
<form style="visibility: hidden" id="form" method="post" action="#" th:action="@{/logout}"></form>
</li>
</ul>
</div>
</div>
</div>
</body>
</html>
的main.css :
h1 {
color: #0000FF;
display: inline;
}
h2 {
color: #FF0000;
}
footer {
margin-top: 60px;
}
.uploadposition {
position: absolute;
right: 0px;
top: 100px;
width: 85%;
}
.navbar-inverse {
margin-bottom: 0px !important;
position: relative !important;
}
.logoImg {
background-size: 70.7%;
background-repeat: no-repeat;
background-position: 50%;
}
.submitButton {
background-color: #24b54b;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
border-radius: 6px;
border: 1px solid #18ab29;
display: inline-block;
cursor: pointer;
color: #ffffff;
font-family: Arial;
font-size: 17px;
padding: 4px 31px;
text-decoration: none;
}
.submitButton:hover {
background-color: #15ad3b;
}
.submitButton:active {
position: relative;
top: 1px;
}
.uploadButton {
background-color: #16529c;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
border-radius: 6px;
border: 1px solid #2958b0;
display: inline-block;
cursor: pointer;
color: #ffffff;
font-family: Arial;
font-size: 17px;
padding: 4px 31px;
text-decoration: none;
}
.uploadButton:hover {
background-color: #0c458a;
}
.uploadButton:active {
position: relative;
top: 1px;
}
.leftNavbar {
width: 10%;
float: left;
}
.navbar .navbar-brand {
padding-top: 5px;
}
.navbar .navbar-brand img {
height: 40px;
width: 70px;
}
body {
padding: 0;
margin: 0;
height: 90vh;
}
.buttons {
position: absolute;
right: 0;
top: 0;
text-decoration: none;
padding: 5px 10px;
margin: 5px;
background: #000;
color: #ccc;
}
.buttons a {
display: block;
}
.button:hover {
color: #ccc;
}
.sidebar {
background: #1a1c1d;
color: #787d80;
width: 125px;
height: 100%;
text-align: left;
transform-origin: left;
transform-style: preserve-3d;
transition: all 0.5s;
overflow: hidden;
}
.sidebar:hideDown {
transform: rotateY(90deg) skewY(10deg);
}
.sidebar:hideUp {
transform: rotateY(90deg) skewY(-10deg);
}
.sidebarHeader {
padding: 20px 10px;
font-weight: 700;
text-align: center;
}
.sidebar ul {
padding: 0;
margin: 0;
list-style-type: none;
display:inline-block;
}
.sidebar li {
padding: 15px 10px;
}
.sidebar a {
text-decoration: none;
color: inherit;
transition: color 0.5s;
}
有人可以帮我这个吗?