在一个词的样式特定信件 [英] Style specific letters in a word

查看:94
本文介绍了在一个词的样式特定信件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我当前的HTML:

<a href="#" id="word">T<span style="font-size: 28px;">est</span><span style="color: pink;">W<span style="font-size: 28px;">ord</span></span></a>

这是可怕的SEO。理想情况下,我想对锚标记执行所有样式:

This is terrible for SEO. Ideally, I'd like all styling done to the anchor tag:

<a href="#" id="word">TestWord</a>

我知道有一个:first-letter selector,但是如何修改 nth 字母并得到我的预期输出?

I understand there is a :first-letter selector, but how can I modify an nth letter and get my expeced output?

jsFiddle: http://jsfiddle.net/HUGKv/1/

推荐答案

目前没有办法通过CSS定位第n个字母。有一些调用CSS允许 n-th 未来的一切,但从今天起,没有这样的运气。

Currently there is no way to target n-th letter through CSS. There are some calls for CSS to allow n-th everything in the future, but as of today, no such luck.

目前,您可能需要使用一些JS方法来解决这个问题。

Currently, you would probably have to use some JS approach to solve this.

这篇关于在一个词的样式特定信件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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