源代码 :
点击运行
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css"> <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/4.7.0/css/font-awesome.css"> </head> <body> <p>With fixed width:</p> <div class="list-group"> <a href="#" class="list-group-item"><i class="fa fa-home fa-fw"></i> Home</a> <a href="#" class="list-group-item"><i class="fa fa-book fa-fw"></i> Library</a> <a href="#" class="list-group-item"><i class="fa fa-pencil fa-fw"></i> Applications</a> <a href="#" class="list-group-item"><i class="fa fa-cog fa-fw"></i> Settings</a> </div> <p>Without fixed width:</p> <div class="list-group"> <a href="#" class="list-group-item"><i class="fa fa-home"></i> Home</a> <a href="#" class="list-group-item"><i class="fa fa-book"></i> Library</a> <a href="#" class="list-group-item"><i class="fa fa-pencil"></i> Applications</a> <a href="#" class="list-group-item"><i class="fa fa-cog"></i> Settings</a> </div> </body> </html>
运行结果