我們所有的在我們的數據庫中的數據全部大寫輸入。當我提取這些信息(即姓和名)時,我希望它說「John Smith」與「JOHN SMITH」。我試過使用text-transform:capitalize;
,但只是大寫第一個字母。它不會使所有其他字母小寫。我也試過這個(沒有成功):大寫首字母只
<div class="profile">
<h2 style="text-transform:lowercase;"><span style="text-transform: capitalize;">Welcome _MEM_FirstName_ _MEM_LastName_,</span></h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam neque lectus, molestie quis ullamcorper ac, vesti bu lum ut elit. Donec quis lacus sem, a pharetra neque. Cras ultricies purus ac ligula lacinia ullamcorper.</p>
<p>Your Walser Rewards card is also your My SA Rewards card. While at Super America locations you can get gas discounts and earn speedy rewards too.</p>
</div>
任何想法如何將文本從大寫轉換爲大寫?
您正在使用什麼語言,從數據庫中提取?它是否有任何類型的'.lower()'函數? – brbcoding 2013-03-08 19:44:12
我要採取一個刺,並說你正在尋找一個JavaScript解決方案,在這種情況下檢查:http://stackoverflow.com/a/196991/1538708 – adamb 2013-03-08 19:45:45
建議,當你從數據庫中獲取數據,將字符串轉換爲小寫,然後應用CSS屬性'text-transform:capitalize;' – sweetamylase 2013-03-08 19:46:15