简体   繁体   中英

How to make first letter lowercase in span with css?

I have this xml

<dg>(<date>B.1987</date>)</dg>

and after formatting with CSS I have this html

<span class="dateGroup"> (<span class="date"> B.1987</span>)</span >

What I want to do is make the letter "B" lowercase so the first letter of the span having the class date. I have searched the internet but it seem's to be only possible for tage <p></p>

Could you advice please?

You also can use the CSS3 pseudoclass '::first-letter' if you don't care about older browser versions! .date

 .date{ display:inline-block; } .date::first-letter { text-transform: lowercase; } 
 <span class="date">B.1234</span> 

You could use the text-tranform property.

.dateGroup {
    text-transform: lowercase;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM