0

I need to set a text to be capitalized, however, the text was written in uppercase, and I cannot change it in the HTML.

So, I've looked arround here and found out that using the "::first-letter" I could do it.

But it's not working, even trying the answers given here to similar questions.

I added display:block, and tried with ".ct" class and "#cboCarteira-ct1" id.

Here is my latest HTML

select {
height: 19px;
font-size: 11px;
color: #fff;
-webkit-appearance: none;
-moz-appearance: window;
text-indent: 0.01px;
text-overflow: '';
appearance: none;
cursor: pointer;
background: #383838 url(../images/select-background.png) no-repeat right center;
border: 1px solid #555;
border-radius: 4px;
box-shadow: 1px 1px 0px #555;
padding-right: 16px;
font-family: 'Saira', sans-serif;
text-transform: lowercase;
display: block;
}
select::first-letter{
text-transform:uppercase;
}
<td style="width:138px; height:20px;"><select id="cboCarteira-ct1" 
style="width:138px;" class="ct"><option id="10893-ct1-o" 
value="10893">CARTEIRA1</option><option id="10906-ct1-o" 
value="10906">TESTE</option></select></td>

My codepen actual https://codepen.io/anon/pen/KvBOXm

Thanks in advance.

bruno
  • 27
  • 7
  • His answer **does not apply to my question** does not help me, I used his code on codepen, and if you take off the size="4" from the HTML it **does not capitalize**. I CANNOT CHANGE THE HTML Here is the codepen with his code, without the "size="4" in his code.https://codepen.io/anon/pen/RZYbpo – bruno Aug 25 '17 at 14:23
  • 1
    The answer does apply to your question, in that it explains that that only works in Chrome and Firefox and only if the select size is greater than one. In other browsers or other circumstances this isn't possible; CSS styling of ` – Daniel Beck Aug 25 '17 at 14:35
  • Oh, I'm sorry then. Thank you for explaining. I'm using both, but I cannot add a size to it. So it is not possible in my case. Sorry for the incovenience, I'll change the title. – bruno Aug 25 '17 at 15:42

0 Answers0