473,385 Members | 1,647 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Title case + CSS

3
Hi There,

I need to 'title case' all the text on my form.

There is no 'title case' option available on .css.
The only options are lowercase, uppercase and capitalize.

/* Capitalize */
text-transform:capitalize;

/* Lowercase */
text-transform:lowercase;

/* Uppercase */
text-transform:uppercase;


Capitilize is probably the closest to title case but will only transform text if it is typed in lowercase.
So --> 'this is the text' will be transformed to --> 'This Is The Text'.
However --> 'THIS IS THE TEXT' will remain as typed. Pretty weird.
What is even more strange is that 'capitalize' does not work on DropDownList's.

If anyone has a solution to title case text (that does not involve javascript or reg ex) - please let me know.

Thanks
Dec 20 '07 #1
1 11223
garrow
32
How about this?

Just be aware that copying the text will still give you the original capitalisation.

[HTML]<html>
<head>
<style type="text/css" media="screen">
p.gimmecaps { text-transform:lowercase; }
p.gimmecaps:first-letter { text-transform:uppercase; }
</style>
</head>
<body>
<p class="gimmecaps">foobarisan</p>
<p class="gimmecaps">FOOBARISAN</p>
<p class="gimmecaps">FoobARisAN</p>
<p class="gimmecaps">fOoBaRiSaN</p>

</body>
</html>[/HTML]
Jan 12 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Peter Bailey | last post by:
Is there a function that will take a name from a table and convert it to title case? ie the first character of the name in upper and the rest lower. The strings in the table have been input in...
3
by: Paul | last post by:
I know of the Ucase() function to convert a string to uppercase. Is there a function to convert a string to Title Case (1st letter of each word capitalized)? Thank you Paul
0
by: Wayne Phipps | last post by:
I read the following article: http://support.microsoft.com/kb/312890/EN-US/ I need to convert the case of a text column in a DataTable object so I wrote a method to do this however, the...
5
by: Greg Collins [InfoPath MVP] | last post by:
I couldn't find anything in my searches... I'm wondering if there's a Regex (with or without additional C# code) that can convert a either "lowerCamelCase" or "UpperCamelCase" into a proper "Title...
7
by: pkirk25 | last post by:
string name; cin >name; User enters "johnny appleseeD". How can I use transform to reformat this as "Johnny Appleseed"? Thanks in advance.
11
by: Ola K | last post by:
Hi, I am pretty new to Python and I want to make a script that will search for the following options: 1) words made of uppercase characters -only- (like "YES") 2) words made of lowercase...
7
by: John Henry | last post by:
I believe the standard dictionary should be amened to allow the use of case insensitive keys - as an option. I found some work done by others to do that at: ...
4
by: titan nyquist | last post by:
Why does ToTitleCase not work if the case is already in upper case? I have to make my string lowercase, first, before I pass to to ToTitleCase to have it work. Titan
1
by: barrathi | last post by:
Hi all i need one query help! for reporting purpose i wrote one query - follows select s.tran_empid as EmpId, e.M_EMPL_NAME as EmpName, p.PROJ_NAME as Project, t.TITL_NAME as Title,CASE WHEN...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.