简体   繁体   English

HTML表格中的颜色未考虑在内

[英]Color in HTML table not taken into account

I use an HTML table on this URL: https://www.pascaldegut.com/pages/prestation-webdesign , with red crosses and green checks. 我在以下URL上使用HTML表格: https : //www.pascaldegut.com/pages/prestation-webdesign ,带有红叉和绿色标记。

It works great on desktop, but using my iPhone (Safari), the crosses and checks are black 它在台式机上运行良好,但是使用我的iPhone(Safari)时,叉号和格子是黑色

在此处输入图片说明

Here is a sample of the code I use 这是我使用的代码示例

<table class="blueTable" border="1" cellpadding="0" cellspacing="0" rules="all" frames="border" style="width: 100%;">
<thead>
<tr>
<th style="width: 40%;">Services</th>
<th style="width: 20%;">Basique</th>
<th style="width: 20%;">PREMIUM</th>
<th style="width: 20%;">GOLD</th>
</tr>
</thead>
<tbody>
<tr>
<td class="text">Audit & CR Vidéo</td>
<td class="check" style="color: #006600">✔</td>
<td class="check" style="color: #006600">✔</td>
<td class="check" style="color: #006600">✔</td>
</tr>
<tr>
<td class="text">Design Page Accueil</td>
<td class="check" style="color: #006600">✔</td>
<td class="check" style="color: #006600">✔</td>
<td class="check" style="color: #006600">✔</td>
</tr>
</tbody>
</table>

Moreover, I tried to force CSS with this code, without success 而且,我尝试用此代码强制CSS,但未成功

  td.cross {
    color: FF0000 !important;
  }

  td.check {
    color: 006600 !important;
  }

Any idea here? 这里有什么主意吗? It's tricky for me to resolve it since I can't replicate the issue from my editor on desktop 我无法解决问题,因为我无法从桌面上的编辑器复制问题

Thank you in advance :) Pascal 在此先感谢您:) Pascal

It's to do with the use of the unicode characters and . 这与使用Unicode字符 I was able to inspect element on my iPhone and it seems to be caused by the iPhone Safari pre-defining the style and colour for those characters used. 我能够检查iPhone上的元素,这似乎是由iPhone Safari预先定义了所用字符的样式和颜色引起的。 By simply changing them to a font, eg Font Awesome , you will be able to achieve what you want. 通过简单地将它们更改为字体,例如Font Awesome ,您将能够实现所需的功能。

Resources: Cross - Tick 资源: 十字 - 勾选

The following are screenshots of my testing: 以下是我的测试屏幕截图: 检查元素:使用<code> x </ code>而不是以前使用的

屏幕快照检查元素的结果。

I think Safari does not find colors that take this formula : #006600 我认为Safari找不到采用以下公式的颜色:#006600

Change it to the following format : style="color: rgb(0,102,0)" 将其更改为以下格式: style="color: rgb(0,102,0)"

 <table class="blueTable" border="1" cellpadding="0" cellspacing="0" rules="all" frames="border" style="width: 100%;"> <thead> <tr> <th style="width: 40%;">Services</th> <th style="width: 20%;">Basique</th> <th style="width: 20%;">PREMIUM</th> <th style="width: 20%;">GOLD</th> </tr> </thead> <tbody> <tr> <td class="text">Audit & CR Vidéo</td> <td class="check" style="color: rgb(0,102,0)">✔</td> <td class="check" style="color: rgb(0,102,0)">✔</td> <td class="check" style="color: rgb(0,102,0)">✔</td> </tr> <tr> <td class="text">Design Page Accueil</td> <td class="check" style="color: rgb(0,102,0)">✔</td> <td class="check" style="color: rgb(0,102,0)">✔</td> <td class="check" style="color: rgb(0,102,0)">✔</td> </tr> </tbody> </table> 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM