-2

I can not get to set the color for SPAN element. The text is an inside label for an input field.

The text is WHITE and I need to it to be BLACK.

I tried this (but not working):

span.main-label span{color: black!important;}

The html is

<span class="sub-label-true"><span class="main-label"><span>Name</span></span><span class="sub-label"><span>your full name</span></span></span>

enter image description here

JPashs
  • 13,044
  • 10
  • 42
  • 65
  • Could you prepare a snippet? I cannot open the link you provided. – er-han Jan 20 '17 at 13:10
  • See: http://stackoverflow.com/questions/2610497/change-an-html5-inputs-placeholder-color-with-css – Is Niska Jan 20 '17 at 13:13
  • Check your CSS, perhaps after the line with "span.main-label span{color: black!important;}" there is another line of CSS where this property is overridden with #fff color. Can you provide a screenshot of the inspector in any browser, where it shows the CSS properties? – yavor.vasilev Jan 20 '17 at 14:14

1 Answers1

-1

It's not text color you're looking for, you need the placeholder color, which is set differently:

::-webkit-input-placeholder { /* Chrome/Opera/Safari */
  color: #000000 !important;
}
::-moz-placeholder { /* Firefox 19+ */
  color: #000000 !important;
}
:-ms-input-placeholder { /* IE 10+ */
  color: #000000 !important;
}
:-moz-placeholder { /* Firefox 18- */
  color: #000000 !important;
}

Edit:

I added !important but I don't recommend you use it. I placed it here because I can't find whatever is setting white placeholder text in your code.

Serg Chernata
  • 12,280
  • 6
  • 32
  • 50
  • The question talks about a span, not the placeholder – Oriol Jan 20 '17 at 13:12
  • 1
    I don't think he knows what the proper terminology is. He has placeholders within html that aren't visible. His span is only used for error messages and it's not white, it's red. – Serg Chernata Jan 20 '17 at 13:14
  • Question is not clear... He says a "white text" inside a span... but the span is red... and the placeholder is white... I don't think a downvote is fairly here... – Pipe Jan 20 '17 at 13:21
  • OP has a language or understanding barrier, doesn't mean we need to downvote him. – Serg Chernata Jan 20 '17 at 13:23