1

I have a few strings of all uppercase letters. I.E THIS IS MY STRING

I know of both

text-transform: capitalize;
text-transform: lowercase;

But is there a way to take these capitilized letters, keep the first letter a capital and lowercase the rest of the characters of the words (multiple words in string)? So the result would be 'This Is My String'

jblz
  • 1,001
  • 2
  • 13
  • 33
  • 2
    you've known of `text-transform:capitalize` but looks like you did not even try it first? http://jsfiddle.net/u2rtv8r5/ – King King Aug 13 '14 at 21:40
  • Sorry, perhaps I wasn't clear, the entire string is capitalized. SO IT LOOKS LIKE THIS. I Want That To Look Like This. http://jsfiddle.net/4z31aqpw/ – jblz Aug 13 '14 at 21:46
  • @jblz Check the [second link](http://stackoverflow.com/questions/22566468/first-letter-capitalize-and-other-letters-in-lower-case-in-css) above. You may find it helpful. – Hashem Qolami Aug 13 '14 at 21:48
  • @HashemQolami looks like the OP need a CSS solution, that's the problem, otherwise with JS we can solve almost everything. – King King Aug 13 '14 at 21:52
  • I'm not sure in which case you could push that all uppercase string into your webpage and use CSS to style it the way you want? it's a bit strange. – King King Aug 13 '14 at 21:53
  • Yeah, I'm using Wordpress so I was hoping to do this all in CSS. I wouldn't be able to surround each word with . The solution provided only capitalizes the first word of the string, am I out of luck? – jblz Aug 13 '14 at 21:59
  • A potential workaround, although even more abstract, would be if I could just lowercase the last letter of each word – jblz Aug 13 '14 at 22:07
  • @jblz it's not even possible with just CSS and no change in HTML. In fact all we have is `text-transform:capitalize;` however it works in a different way, it just ensures the first letter of each word to be capitalized, all the other letters are kept unchanged (ignored). So looks like you're really stuck at this, it's not your fault anyway. – King King Aug 13 '14 at 22:15

0 Answers0