源代码 :
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Bootstrap 实例 - 实现水平列表</title> <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css"> <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script> <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script> <style> .list-group-horizontal .list-group-item { display: inline-block; } .list-group-horizontal .list-group-item { margin-bottom: 0; margin-left:-4px; margin-right: 0; } .list-group-horizontal .list-group-item:first-child { border-top-right-radius:0; border-bottom-left-radius:4px; } .list-group-horizontal .list-group-item:last-child { border-top-right-radius:4px; border-bottom-left-radius:0; } </style> </head> <body> <div class="container"> <div class="row" style="padding-top:50px"> <div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 text-center"> <div class="list-group list-group-horizontal"> <a href="#" class="list-group-item active">Google</a> <a href="#" class="list-group-item">Runoob</a> <a href="#" class="list-group-item">Taobao</a> <a href="#" class="list-group-item">Github</a> </div> </div> <div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 text-center"> <div class="list-group list-group-horizontal"> <a href="#" class="list-group-item">Google</a> <a href="#" class="list-group-item active">Runoob</a> <a href="#" class="list-group-item">Taobao</a> <a href="#" class="list-group-item">Github</a> </div> </div> </div> </div> </body> </html>
运行结果