在这个链接中,我尝试过,它确实将文本从小写转换为大写,但它没有将大写转换为大写。
例如,使用'text-transform:大写;‘不会将"HELLO“转换为"Hello”。
提前感谢!
发布于 2017-03-29 07:53:28
试试这个..。这应该管用!:
.link { text-transform: lowercase; }
.link:first-letter { text-transform: uppercase; }(SRC:https://stackoverflow.com/a/10256138/7703846)
编辑:
这不是一个明确的解决方案,因为没有其他方法通过css解决您的问题,它只会大写第一个字母,例如.整个p/ div元素!如果你想在span上使用它,你需要添加显示:块/显示:内联块!(thx至helb)
EDIT2:(例子)
<!DOCTYPE html>
<html>
<head>
<style>
p.capitalize {
text-transform: lowercase;
}
p.capitalize:first-letter {
text-transform: uppercase;
}
</style>
</head>
<body>
<p class="capitalize">THIS IS SOME TEXT.</p>
</body>
</html>https://stackoverflow.com/questions/43087470
复制相似问题