target first letter of each word in css

谁说胖子不能爱 提交于 2019-11-28 06:09:12

问题


I need to change size, color, and weight of every first letter of each word. I am not talking about Capitalize each first letter. I mean that target first letter and apply style according to my choice. : Click Here to see example about which i am talking.


回答1:


AFAIK to achieve this you will have to write the 1st letter in seperate tag like label or div or p tag and apply css to this tag and put rest letters in normal tag

UPDATE: As per your comment if you are getting sentence from text field you will have to make a Javascript that will loop through all words and with the help of substr find the 1st character of each word and appy css by putting it in a tag and keep rest letters outside the tag then replace final output with original text



来源:https://stackoverflow.com/questions/46853623/target-first-letter-of-each-word-in-css

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!