Inline and Inline-block Lists

list

Key points:

ul { list-style: none; }
li { display: inline; }

or

ul { list-style: none; }
li { display: inline-block; }

list-style: none

Example 6.3 - list-style: none; - Example 6.3 (Without Styles) |
<ul id="extglobalnav">
<li>About</li>
<li>Calendar</li>
<li>Courses</li>
<li>Contact Us</li>
<li>Faculty Directory</li>
<li>Login</li>
</ul>

In style element (<style type="text/css">) within head element:

ul#extglobalnav {
  list-style: none;
}
 

list

li {display: inline;}

Example 6.4 - list-style: none; - Example 6.4 (Without Styles) |
<ul id="extglobalnav">
<li>About</li>
<li>Calendar</li>
<li>Courses</li>
<li>Contact Us</li>
<li>Faculty Directory</li>
<li>Login</li>
</ul>

In style element (<style type="text/css">) within head element:

ul#extglobalnav {
  list-style: none;
  padding-left: 0;
}
ul#extglobalnav li {
  display: inline;
  padding-left: 2em;
}
 

list

li {display: inline-block;}

Example 6.5 - list-style: none; - Example 6.5 (Without Styles) |
<ul id="extglobalnav">
<li>About</li>
<li>Calendar</li>
<li>Courses</li>
<li>Contact Us</li>
<li>Faculty Directory</li>
<li>Login</li>
</ul>

In style element (<style type="text/css">) within head element:

ul#extglobalnav {
  list-style: none;
  padding-left: 0;
}
ul#extglobalnav li {
  display: inline-block;
  width: 8em;
  border: thin solid black;
  margin-right: 3px;
  text-align: center
}
 

list

Copyright © David Heitmeyer