Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

li:before{ content: "■"; } How to Encode this Special Character as a Bullit in an Email Stationery?

After proudly coloring my liststyle bullet without any image url or span tags, via:

ul{ list-style: none; padding:0;  margin:0;  } li{ padding-left: 1em; text-indent: -1em;    } li:before { content: "■"; padding-right:7px; } 

Although these stylesheets work perfectly down to the rounded borders and other css3 stuff, and although the recipient of the email (for instance, Eudora OSE 1) renders all css styles correctly, just like in a browser, there is one problem: the bullets like or become converted into &#adabacadabra;

Appearing finally like so in emails:

enter image description here

How do I proceed from here?

like image 597
Sam Avatar asked Mar 15 '11 18:03

Sam


People also ask

How do you encode a bullet?

The Unicode character for showing the dot symbol or bullet point is U+2022 . But to use this Unicode correctly, remove the U+ and replace it with ampersand ( & ), pound sign ( # ), and x . Then type the 2022 number in, and then add a semi-colon. So, it becomes • .

How do I make bullet points color in HTML?

However, if you do change the markup, one solution is to wrap the text of each list item in an extra element, e.g., a SPAN. If the list item looks like this: <li><span>First item</span></li> then you can make the bullet red and the text black with `li {color: red}' and `li span {color: black}'.

How do you change the color of a bullet in CSS?

There are two ways to change the color of the bullet:Using an extra markup tag. Using Css style ::before selector.


2 Answers

Never faced this problem before (not worked much on email, I avoid it like the plague) but you could try declaring the bullet with the unicode code point (different notation for CSS than for HTML): content: '\2022'. (you need to use the hex number, not the 8226 decimal one)

Then, in case you use something that picks up those characters and HTML-encodes them into entities (which won't work for CSS strings), I guess it will ignore that.

like image 113
Lea Verou Avatar answered Sep 19 '22 05:09

Lea Verou


You ca try this:

ul { list-style: none;}  li { position: relative;}  li:before {     position: absolute;       top: 8px;       margin: 8px 0 0 -12px;         vertical-align: middle;     display: inline-block;     width: 4px;     height: 4px;     background: #ccc;     content: ""; } 

It worked for me, thanks to this post.

like image 45
amit trvedi Avatar answered Sep 20 '22 05:09

amit trvedi