Does anyone have an idea how one might force UPPERCASE text into "Title Case" or in other words force the characters aftter the initial cap into lower case? For example: JOHN SMITH --> John Smith Any help would be appreciated. Thank you.
I don't think you can, you can do all uppercase or all lowercase but I don't think you can unless you gave the first letter a <span> or id and the rest of the word a different span or id.
You could probably use a cross of php and css to do it. You could use the explode function to break apart a string. Count how many words are in the array (so you do it to all words) Then as jmhyer mentioned, you would have to turn around and add in <span class="something"> tags for the first character of each word. Span the rest to force lowercase. Seems like a lot of work for Title case though.
Why is the text in all upper-case anyway? As it is, without using extra markup, the best you can do is to either resort to JavaScript, or to use a server-side script to re-write the string.
Thank you all for your suggestions. Unfortunately the gist of the advice is what I feared- it is not possible to control this behavior with CSS. Just a little background if you're interested: I am taking the results from a database query and formatting the rendered display in a web application. The information in the database is stored as upper-case. However some of the users want the display to be in title-case. I was looking for a simple solution to customize the style without adding a lot of processing time building the result set (which consists of thousands of lines). It seems to me this is just the sort of thing that CSS was meant for, but apparently this is just a blind-spot for now. Thanks again. -S.
That won't work, as all the letters have already been capitalized. They'll just be smaller, but still all capitalized. small-caps works best when you have regular text with a mixture of upper and lower case characters.
Hi, I had the similer need. I used 'text-transform: capitalize;' and it worked. Hope this is usefull. thanks Balks