HTML list-style-type dash

There is an easy fix (text-indent) to keep the indented list effect with the :before pseudo class. ul { margin: 0; } ul.dashed { list-style-type: none; } ul.dashed > li { text-indent: -5px; } ul.dashed > li:before { content: “-“; text-indent: -5px; } Some text <ul class=”dashed”> <li>First</li> <li>Second</li> <li>Third</li> </ul> <ul> <li>First</li> <li>Second</li> <li>Third</li> … Read more

How to display an unordered list in two columns?

Modern Browsers leverage the css3 columns module to support what you are looking for. http://www.w3schools.com/cssref/css3_pr_columns.asp CSS: ul { columns: 2; -webkit-columns: 2; -moz-columns: 2; } http://jsfiddle.net/HP85j/8/ Legacy Browsers Unfortunately for IE support you will need a code solution that involves JavaScript and dom manipulation. This means that anytime the contents of the list changes you … Read more

How to keep indent for second line in ordered lists via CSS?

Update This answer is outdated. You can do this a lot more simply, as pointed out in another answer below: ul { list-style-position: outside; } See https://www.w3schools.com/cssref/pr_list-style-position.asp Original Answer I’m surprised to see this hasn’t been solved yet. You can make use of the browser’s table layout algorithm (without using tables) like this: ol { … Read more

How to set Bullet colors in UL/LI html lists via CSS without using any images or span tags [duplicate]

The most common way to do this is something along these lines: ul { list-style: none; padding: 0; margin: 0; } li { padding-left: 1em; text-indent: -.7em; } li::before { content: “• “; color: red; /* or whatever color you prefer */ } <ul> <li>Foo</li> <li>Bar</li> <li>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed … Read more

tech