If you want to create an unordered list in HTML (
<ul>) that lists items horizontally while maintaining the bullets this bit of code should help you. This method is more flexible than
display: inline-block or
float: left, allowing you to control the styles used for the bullet.
The last CSS selector will remove a bullet from the first item, which is ideal in for design in some circumstances. If you want the first item to include a bullet just remove the
.list-horizontal li:first-child:before styles.
About the Author
Kevin Leary is a freelance developer in Boston, MA with a strong portfolio of work, and over 13 years of experience as a programming consultant and digital strategy provider. Interested in working together? Hire me for your next project.