bringing back list styles in a section after they have been removed from section\'s parent

/ Published in: CSS
Save to your folder(s)

We use lists for all sorts of things, especiall navigation elements for which bullets don't make sense. Often, it is most convenient to remove bullet/list styles from all list elements globally. In fact many css resets do just that. However, there may be content areas where we do want bullets! The following css brings back the list styles for all list elements within a container with the class "bulletsAvailable". These values approximate the normal default browser behavior.

Copy this code and paste it in your HTML
  1. .bulletsAvailable ul, .bulletsAvailable ol {margin-left: 20px;}
  2. .bulletsAvailable ul {list-style-type: circle;}
  3. .bulletsAvailable ul li, .bulletsAvailable ol li {display: list-item; float:none; }
  4. .bulletsAvailable ul li { list-style-type:disc; }
  5. .bulletsAvailable ol li { list-style-type:decimal; }

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.