1000字范文,内容丰富有趣,学习的好帮手!
1000字范文 > CSS实现英文或拼音单词首字母大写

CSS实现英文或拼音单词首字母大写

时间:2022-04-26 20:20:21

相关推荐

CSS实现英文或拼音单词首字母大写

CSS实现英文或拼音单词首字母大写,只需要在css样式中加入:

text-transform: capitalize

即可。

测试代码如下:

<!doctype html><html><head><meta charset="utf-8"><title>英文或拼音单词首字母大写</title><style>.shou_daxie {text-transform: capitalize}.quan_daxie {text-transform: uppercase}.quan_xiaoxie {text-transform: lowercase}</style></head><body><div class="shou_daxie"> 首字母大写:&nbsp;&nbsp;the bus will depart at the scheduled time regardless of latecomers</div><div class="quan_daxie"> 字母全实现大写:&nbsp;&nbsp;tHe Bus wIll dePart at the scHeduled Time rEgardless of latecomers</div><div class="quan_xiaoxie"> 字母全实现小写:&nbsp;&nbsp;tHe Bus wIll dePart at the scHeduled Time rEgardless of latecomers</div></body></html>

结果如下:

首字母大写: The Bus Will Depart At The Scheduled Time Regardless Of Latecomers字母全实现大写: THE BUS WILL DEPART AT THE SCHEDULED TIME REGARDLESS OF LATECOMERS字母全实现小写: the bus will depart at the scheduled time regardless of latecomers

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。