enjoylife enjoylife - 1 year ago 160
CSS Question

make the first character uppercase in css

is there a way to make the first character uppercase in the a label in css.
the html structure is

<a class="m_title" href="">gorr</a>
<a class="m_title" href="">trro</a>
<a class="m_title" href="">krro</a>
<a class="m_title" href="">yrro</a>
<a class="m_title" href="">gwwr</a>

Answer Source

There's a property for that:

a.m_title {
    text-transform: capitalize;

If your links can contain multiple words and you only want the first letter of the first word to be uppercase, use :first-letter with a different transform instead (although it doesn't really matter). Note that in order for :first-letter to work your a elements need to display as blocks:

a.m_title {
    display: block;

a.m_title:first-letter {
    text-transform: uppercase;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download