我需要将下一个字符串大写 css

I need to capitalize the next string css

我需要将下一个字符串大写css

1- 项

.table-generic p::first-letter {
text-transform: uppercase;}

我怎样才能用开头的那个数字来做到这一点?

对于这种特定情况,您可以只在元素本身上使用 text-transform: capitalize(而不是 first-letter 伪元素)。

p {
  text-transform: capitalize;
}
<p>1- item</p>

也许您还有其他要求或限制,但从您的问题中看不出来。