·

li :before content: "✔ "; different color on some mobile devices

Published at 2024-08-21 22:02:31Viewed 136 times
Professional article
Please reprint with source link

Question

I write css to make li tags better.

Everything is ok on laptop and my mobile phone(lenovo vibe 1) and asus zenfone 5

But when Itested on Iphone 5 and Galaxy Note3 my color (rgb(240, 230, 140)) shown as red and black.

I don't know what is wrong with my css. Should I use image istead of css or Is there a solution with css? Thanks.

Here is my css:

ul.anamenu li::before {
content: "✔ ";
color: rgb(240, 230, 140);
font-size: 4vmin;
text-indent: -2em;}


Answer1

Try to add font-family: 'Zapf Dingbats' on ul.anamenu li::before. It works well on iPhone.

EDIT: JUN 26 '17
The issue exists because this character is now an emoji drawn by Apple (and other constructors). On emojipedia website, you can see some variations of this emoji.
So, your rendered character is a bitmap image on your device and not a vector glyph that you could change color. Constructors or platforms that implements emojis are free to design their own emojis as they want (with black, red, pink or other colors if they want). That's why we may misunderstanding the meaning of one emoji depending on the platform where we see it.

There are currently 1,282 emoji in the Unicode standard, set by the Unicode Consortium, which provides a name, such as U+1F600 for 'grinning face,' but critically doesn't dictate what the emoji should look like.

To change color of this character, you have to work on text. So, you can use a variation selector 15 directly after the check mark to get a regular text version: ✔︎ (in HTML). Some exemples for differents languages here.

By the way, concerning Heavy Check Mark, you can try this solution using variation selector
content: "\2714 \fe0e";. As you see, there are unicode symbole in CSS: '\2714' and the VARATION SELECTOR '\fe0e' directly after.

.unicode:after{
  content: '\2714 \fe0e';
  color: red;
}
<div class="unicode">
</div>


Answer 2

As Alex - DJDB said you can't change the color of this html symbol. But You can use another. Using ✓ check mark (U+2713) allows you to change the color of the symbol.

I found it here: https://graphemica.com/%E2%9C%93

html {
  color: red;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}
<p>✓ check mark (U+2713)</p>
<p>✔ heavy check mark (U+2714)</p>


The content is from StackOverflow which is translated and used in accordance with the CCBY-SA 4.0 license agreement. Original link: li :before content: "✔ "; different color on some mobile devices

Comments

There is no comment, let's add the first one.

弦圈热门内容

Django change an existing field to foreign key

I have a Django model that used to look like this:class Car(models.Model): manufacturer_id = models.IntegerField()There is another model called Manufacturer that the id field refers to. However, I realized that it would be useful to use Django's built-in foreign key functionality, so I changed the model to this:class Car(models.Model): manufacturer = models.ForeignKey(Manufacturer)This change appears to work fine immediately, queries work without errors, but when I try to run migrations, Django outputs the following:- Remove field manufacturer_id from car - Add field manufacturer to carDoing this migration would clear all the existing relationships in the database, so I don't want to do that. I don't really want any migrations at all, since queries like Car.objects.get(manufacturer__name="Toyota") work fine. I would like a proper database foreign key constraint, but it's not a high priority.So my question is this: Is there a way to make a migration or something else that allows me to convert an existing field to a foreign key? I cannot use --fake since I need to reliably work across dev, prod, and my coworkers' computers.内容来源于 Stack Overflow, 遵循 CCBY-SA 4.0 许可协议进行翻译与使用。原文链接:Django change an existing field to foreign key

Get connected with us on social networks! Twitter

©2024 Guangzhou Sinephony Technology Co., Ltd All Rights Reserved