Style Unordered Lists with Bootstrap

Unordered Lists

A list of items in which the order does not explicitly matter.


<!DOCTYPE HTML>
<html> 
<head> 
<link href="http://java2s.com/style/bootstrap.min.css" rel="stylesheet">
</head><!--from  w ww.j a va  2s  .  c  o  m-->
<body style='margin:20px;'>

    <ul>
      <li>Java</li>
      <li>CSS</li>
      <li>HTML</li>
      <li>Bootstrap</li>
      <li>HTML5</li>
      <li>CSS3</li>
    </ul>
        
</body>
</html>

Click to view the demo

Unstyled List

Remove the default list-style and left margin on list items (immediate children only). This only applies to immediate children list items, meaning you will need to add the class for any nested lists as well.


<!DOCTYPE HTML>
<html> 
<head> 
<link href="http://java2s.com/style/bootstrap.min.css" rel="stylesheet">
</head><!--   ww w.j av  a2 s . com-->
<body style='margin:20px;'>
<ul class="list-unstyled">
  <li>Java</li>
  <li>CSS</li>
  <li>HTML</li>
  <li>Bootstrap</li>
  <li>HTML5</li>
  <li>CSS3</li>
</ul>
</body>
</html>

Click to view the demo

Inline List

Place all list items on a single line with inline-block and some light padding.


<!DOCTYPE HTML>
<html> 
<head> 
<link href="http://java2s.com/style/bootstrap.min.css" rel="stylesheet">
</head><!--  www .ja v a 2 s . c om-->
<body style='margin:20px;'>
<ul class="list-inline">
  <li>Java</li>
  <li>CSS</li>
  <li>HTML</li>
  <li>Bootstrap</li>
  <li>HTML5</li>
  <li>CSS3</li>
</ul>

</body>
</html>

Click to view the demo





















Home »
  Bootstrap »
    Bootstrap »




Introduction
Basic HTML Style
List
Table
Form
Layout
Navigation Bar
Button
Control