Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use &middot; instead of bullet for <ul>

Tags:

I found an article on the list-style-type property in CSS, but it doesn't list the &middot; (·) as an option, as opposed to the default disc or &bullet; (&bullet;). Is there a way to do this with HTML or CSS?

like image 215
steveo225 Avatar asked Nov 18 '11 01:11

steveo225


People also ask

Whats a better word for use?

The words employ and utilize are common synonyms of use. While all three words mean "to put into service especially to attain an end," use implies availing oneself of something as a means or instrument to an end.

Is the word Use a noun or verb?

verb (used with object), used, us·ing. to employ for some purpose; put into service; make use of: to use a knife. to avail oneself of; apply to one's own purposes: to use the facilities. to expend or consume in use: We have used the money provided.

Did you use to or used to?

It may be that many people in fact say use to rather than used to, but since the pronunciations are essentially identical, it makes no difference. (The same occurrence happens in the pronunciation of supposed to.) In writing, however, use to in place of used to is an error.


2 Answers

CSS (works in any browser supporting :before and content: ):

li:before {      content: '\b7\a0'; /* \b7 is a middot, \a0 is a space */ } li {     list-style:none;     text-indent:-.5em; /* helps make it look more like it's a bullet. */ } 

Caution: It is not a real list style. Therefore, when you have wrapped lists, it will look funny. This can perhaps be mitigated by a negative text-indent of a few units to get it to function more like a list-style.


Another implementation:

li:before {     content: '\b7\a0';     position:absolute;     right:100% } li {     list-style:none;     position:relative; } 

This version seems to work better. I often use :before and :after to add extra things like borders, but if you are adding a bullet I imagine that that is not the case. Even though this is the alternate suggestion, it is probably the preferred one.

like image 155
Levi Morrison Avatar answered Oct 05 '22 23:10

Levi Morrison


Yes! You can use the before pseudo-class to insert the character before each item.

.DotList li:before {     content: "·"; } 

Here is an example jsFiddle.

like image 42
Maxpm Avatar answered Oct 05 '22 22:10

Maxpm