Reputation: 15
How to make the first letter as capital in a string and display the string as italic..
Input:
hyptis suavalovens
I am trying to get the output like this...
*Hyptis suavalovens*
Upvotes: 0
Views: 124
Reputation: 1631
Do it with CSS:
p:first-letter {
text-transform: capitalize;
}
p {
font-style: italic;
}
<p>input:hyptis suavalovens</p>
<p>i am trying to get the output like this...</p>
<p>*hyptis suavalovens*</p>
Upvotes: 1
Reputation: 3228
You can use :first-letter selector.
<p id="mytext">hyptis suavalovens</p>
#mytext{
font-style: italic;
}
#mytext:first-letter {
text-transform: uppercase;
}
Upvotes: 2
Reputation: 309
use this
Input:first-letter {
text-transform: uppercase;
font-style: Italic;
}
Upvotes: 1