Is it possible to humanize text using CSS and then reuse it?

I have a part of the text coming to me from an external source, which is EVERYTHING. I want her to be just capitalized in the first letter. It seems that text-transform:capitalize will not filter out the rest of the word. Any way to do this without JS?

+4
source share
4 answers

Something like that? http://jsbin.com/agocu3/2

CSS

  p { text-transform: lowercase;} p:first-letter {text-transform:capitalize} 

HTML

 <p>YOUR TEXT GOES HERE</p> 
+7
source

You can put the text in lowercase and then use the pseudo selector: first letter in upper case first letter

 p { text-transform: lowercase; } p:first-letter { text-transform: uppercase; } 
+2
source

Do not use CSS, just use this:

http://www.convertcase.net/

Significant cleaning and great processing taken from the browser.

0
source

If you are using a server language:

Lowercase using server side language to the text you want to use, and then use the css property for this element to use.

Here's how it worked for me:

Server language: VB.net Inside the repeater - data coming from the database

 <span class="capitalize"><%# Eval("RecipientFirstName").ToString.ToLower()%></span> 

Converted to lowercase

CSS

 .capitalize{ text-transform: capitalize; } 
0
source

Source: https://habr.com/ru/post/1339556/


All Articles