Varun Krishnan
Varun Krishnan

Reputation: 15

To make first letter in a string as capital and make the font as italic

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

Answers (3)

Mr7-itsurdeveloper
Mr7-itsurdeveloper

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>

http://jsfiddle.net/ez3Lv/2/

Upvotes: 1

Saranga
Saranga

Reputation: 3228

You can use :first-letter selector.

<p id="mytext">hyptis suavalovens</p>
#mytext{
    font-style: italic;
}
#mytext:first-letter {
    text-transform: uppercase;
}

DEMO

Upvotes: 2

rAm
rAm

Reputation: 309

use this

Input:first-letter {
text-transform: uppercase;
font-style: Italic;
}

Upvotes: 1

Related Questions