通过CSS着色特定字符 [英] Colouring a specific character through CSS

查看:141
本文介绍了通过CSS着色特定字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



每个单词之间的行是我想要的与文本的其余部分不同的颜色,但我想在CSS中这样做,而不是可怕地添加到每个只是为了改变它的颜色。


防病毒终点|磁盘加密| UTM |电子邮件和网络安全


可以通过CSS吗?



我尝试了,但我不认为我会接近。

  | {
color:#00FF00;
}


解决方案

|字符在一个span中,您可以使用:

 < span class =separator> |& span> 

.separator {
color:#0F0;
}


What I am after is to colour in just one character of my code throughout the page.

The lines between each of the words are what I would like to be a different colour from the rest of the text but I would like to do this in CSS rather than horribly adding to each one just to change its colour.

Anti-virus End Point | Disk Encryption | UTM | Email and Web Security

Is it possible through CSS?

here is what I have attempted but I don't think I'm coming close.

  | {
     color:#00FF00;
     }

解决方案

If you wrap each of the | character in a span with a class you can use that:

<span class="separator">|</span>

.separator {
    color: #0F0;
}

这篇关于通过CSS着色特定字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆