Bootstrap 网页实例
代码:
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>网页实例</title> <link rel="stylesheet" href="css/bootstrap.min.css" /> <style> body { padding-top: 50px; padding-bottom: 40px; color: #5a5a5a; } /* 下面是左侧导航栏的代码 */ .sidebar { position: fixed; top: 51px; bottom: 0; left: 0; z-index: 1000; display: block; padding: 20px; overflow-x: hidden; overflow-y: auto; background-color: #ddd; border-right: 1px solid #eee; } .nav-sidebar { margin-right: -21px; margin-bottom: 20px; margin-left: -20px; } .nav-sidebar > li > a { padding-right: 20px; padding-left: 20px; } .nav-sidebar > .active > a, .nav-sidebar > .active > a:hover, .nav-sidebar > .active > a:focus { color: #fff; background-color: #428bca; } 已久 .main { padding: 20px; } .main .page-header { margin-top: 0; } </style> </head> <body> <nav class="navbar navbar-default navbar-inverse navbar-fixed-top" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#">某管理系统</a> </div> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav"> <li class="active"><a href="#">首页</a></li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">功能<span class="caret"></span></a> <ul class="dropdown-menu" role="menu"> <li class="dropdown-header">业务功能</li> <li><a href="#">信息建立</a></li> <li><a href="#">信息查询</a></li> <li><a href="#">信息管理</a></li> <li class="divider"></li> <li class="dropdown-header">系统功能</li> <li><a href="#">设置</a></li> </ul> </li> <li><a href="#">帮助</a></li> </ul> <form class="navbar-form navbar-right" role="search"> <div class="form-group"> <input type="text" class="form-control" placeholder="用户名..."> <input type="text" class="form-control" placeholder="密码..."> </div> <button type="submit" class="btn btn-default">登录</button> </form> </div> </div> </nav> <!—自适应布局--> <div class="container-fluid"> <div class="row"> <!—左侧导航栏--> <div class="col-sm-3 col-md-2 sidebar"> <ul class="nav nav-sidebar"> <li class="active"><a href="#">首页</a></li> </ul> <ul class="nav nav-sidebar"> <li><a href="#">信息建立</a></li> <li><a href="#">信息查询</a></li> <li><a href="#">信息管理</a></li> </ul> <ul class="nav nav-sidebar"> <li><a href="#">设置</a></li> <li><a href="#">帮助</a></li> </ul> </div> <!—右侧管理控制台--> <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main"> <h1 class="page-header">管理控制台</h1> <p> <!—一组按钮控件--> <button type="button" class="btn btn-lg btn-default">操作1</button> <button type="button" class="btn btn-lg btn-primary">操作2</button> <button type="button" class="btn btn-lg btn-success">操作3</button> <button type="button" class="btn btn-lg btn-info">操作4</button> <button type="button" class="btn btn-lg btn-warning">操作5</button> <button type="button" class="btn btn-lg btn-danger">操作6</button> </p> <div class="row"> <div class="col-md-6"> <div class="panel panel-primary"> <div class="panel-heading"> <h3 class="panel-title">最新提醒</h3> </div> <div class="panel-body"> <div class="alert alert-success" role="alert"> <p><strong>提示</strong>您的订单(2014001)已经审批通过! </p> </div> <div class="alert alert-info" role="alert"> <p><strong>提示</strong>您的订单(2014002)被打回! </p> </div> <div class="alert alert-warning" role="alert"> <p><strong>提示</strong>您的订单(2013001)客户付款延迟! </div> <div class="alert alert-danger" role="alert"> <p><strong>提示</strong>您的订单(2013001)客户付款延迟! </p> </div> </div> </div> </div> <div class="col-md-6"> <div class="panel panel-primary"> <div class="panel-heading"> <h3 class="panel-title">我的任务</h3> </div> <div class="panel-body"> <ul class="nav nav-pills nav-stacked" role="tablist"> <li role="presentation"> <a href="#" class="alert alert-info"> <span class="badge pull-right">42</span> 订单审批 </a> </li> <li role="presentation"> <a href="#" class="alert alert-info"> <span class="badge pull-right">20</span> 收款确认 </a> </li> <li role="presentation"> <a href="#" class="alert alert-info"> <span class="badge pull-right">10</span> 付款确认 </a> </li> <li role="presentation"> <a href="#" class="alert alert-info"> <span class="badge pull-right">1</span> 退款确认 </a> </li> </ul> </div> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="panel panel-primary"> <div class="panel-heading"> <h3 class="panel-title">最新订单</h3> </div> <div class="panel-body"> <table class="table"> <thead> <tr> <th>#</th> <th>产品</th> <th>数量</th> <th>总金额</th> <th>业务员</th> </tr> </thead> <tbody> <tr> <td>1</td> <td>Apple Macbook air</td> <td>10 </td> <td>80000</td> <td>王小贱</td> </tr> <tr> <td>2</td> <td>Apple iPad air</td> <td>20 </td> <td>65000</td> <td>张姆</td> </tr> <tr> <td>3</td> <td>小米</td> <td>10 </td> <td>20000</td> <td>流苏</td> </tr> </tbody> </table> <p><a class="btn btn-primary" href="#" role="button">查看详细»</a></p> </div> </div> </div> <div class="col-md-6"> <div class="panel panel-primary"> <div class="panel-heading"> <h3 class="panel-title">工程进度</h3> </div> <div class="panel-body"> <h3><span class="label label-primary">水井挖掘工程</span></h3> <div class="progress"> <div class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%;"> <span class="sr-only">60% Complete</span> </div> </div> <h3><span class="label label-danger">软件工程</span></h3> <div class="progress"> <div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 40%;"> <span class="sr-only">60% Complete</span> </div> </div> </div> </div> </div> </div> </div> <script type="text/javascript" src="js/jquery-3.0.0.min.js" ></script> <script type="text/javascript" src="js/bootstrap.min.js" ></script> </body> </html>
效果:
越努力越幸运