下面将展示后台页面的创建及效果图展示:
实例
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <link rel="stylesheet" href="static/css/bootstrap.css"> <!-- <link rel="stylesheet" href="static/css/">--> <title>bootstrap</title> <style> .col-md-12 { padding: 0; } .navbar-default { background-color: lightskyblue; border-radius: 0; color: white; } .navbar-default .navbar-brand { color: white; } .navbar-default .navbar-nav > li > a { color: white; } .list-group > a { line-height: 50px; } </style> </head> <body onload="show(this)"> <div class="container-fluid"> <div class="row"> <div class="col-md-12"> <nav class="navbar navbar-default"> <div class="container-fluid"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> <a class="navbar-brand" href="#">后台管理系统</a> </div> <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav navbar-right"> <li><a href="#">admin</a></li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">常用操作 <span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">个人中心</a></li> <li><a href="#">安全设置</a></li> <li><a href="#"></a></li> <li role="separator" class="divider"></li> <li><a href="#">退出登录</a></li> </ul> </li> </ul> </div><!-- /.navbar-collapse --> </div><!-- /.container-fluid --> </nav> </div> </div> </div> <div class="container"> <div class="row"> <div class="col-md-3" > <div class="list-group" style="margin-top: 55px"> <a href="user.html" class="list-group-item" onclick="show(this);return false">用户管理</a> <a href="goods.html" class="list-group-item" onclick="show(this);return false">商品管理</a> <a href="system.html" class="list-group-item" onclick="show(this);return false;">系统设置</a> </div> </div> <div class="col-md-9"> <div class="content" style="min-height: 450px;"></div> <p class="text-center">茶二网络科技***©版权所有 <br>(208-2020)</p> </div> </div> </div> <script src="static/js/jquery-3.4.1.js"></script> <script src="static/js/bootstrap.js"></script> <script> function show(ele){ var url=ele.href|| 'welcome.html'; var request=new XMLHttpRequest(); request.onreadystatechange = function () { if (request.readyState === 4) { var content = document.getElementsByClassName('content').item(0); content.innerHTML = request.responseText; } }; request.open('GET', url, true); request.send(null); } </script> </body> </html>
运行实例 »点击 "运行实例" 按钮查看在线实例