如何将css仅应用于/或任何< p>< p>元件? [英] How to apply css to only numbers in a text inside/or any <p><p> element?

查看:157
本文介绍了如何将css仅应用于/或任何< p>< p>元件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的网站使用区域语言unicode字体,但数字看起来不好。

I am Using a Regional language unicode font-face in my site but the numbers are not looking good.

因此,我只想将新的字体样式或CSS应用到数字。

So i want to apply new font-style or css to numbers only..

p>

推荐答案

这可以使用CSS的 @ font-face中的css-fonts-3-20131003 /#unicode-range-desc> unicode-range

数字0到9存在于Unicode范围内 U + 0030 U + 0039 。因此,您需要做的是在您现有的字体旁边添加一个字体,该字体专门针对此范围:

The numbers 0 to 9 exist in Unicode within the range U+0030 to U+0039. So what you'll need to do is include a font alongside your existing font which specifically targets this range:

@font-face { 
    font-family: 'My Pre-Existing Font';
    ...
}
@font-face {
    font-family: 'My New Font Which Handles Numbers Correctly';
    ...
    unicode-range: U+30-39;
}

这样做的结果是每个Unicode字符实例 U + 0030 (0)到 U + 0039 (9)将以特定目标为该范围的字体显示,其他字符将以您当前的字体。

The result of this will be that every instance of Unicode characters U+0030 (0) through to U+0039 (9) will be displayed in the font which specifically targets that range, and every other character will be in your current font.

这篇关于如何将css仅应用于/或任何< p>< p>元件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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