Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

input[type=number] placeholder color in FF29+

<input type="text" placeholder="test" />
<input type="number" placeholder="test" />

How do I style it?

:-moz-placeholder {
  color: red;
  opacity: 1;
}

::-moz-placeholder {
  color: red;
  opacity: 1;
}

Why doesn't the global placeholder work on it, even though firebug shows it's applied? Is it a bug, is it an intention?

http://jsbin.com/papad/1/edit?html,css,output

enter image description here

like image 623
fxck Avatar asked May 07 '14 08:05

fxck


People also ask

How do I change the color of placeholder input box?

In most browsers, the placeholder text is grey. To change this, style the placeholder with the non-standard ::placeholder selector. Note that Firefox adds a lower opacity to the placeholder, so we use opacity: 1 to fix this.

How can I change placeholder color?

<input placeholder="Stack Snippets are awesome!">

What is input placeholder color?

The placeholder text is set with the placeholder attribute, which specifies a hint that describes the expected value of an input field. Tip: The default color of the placeholder text is light grey in most browsers.

How do you put a placeholder in an input type number?

The placeholder attribute specifies a short hint that describes the expected value of a number field (e.g. a sample value or a short description of the expected format). The short hint is displayed in the number field before the user enters a value.

How to modify the input placeholder color using CSS?

To modify the input placeholder color and other properties, you have to use the example CSS as given below: ::placeholder: The selector selects the placeholder of input text and works on major browsers. However, it will not work on Internet Explorer and Microsoft Edge.

What is input number placeholder in HTML?

The DOM Input Number placeholder Property in HTML DOM is used to set or return the value of the placeholder attribute of a number field. The placeholder attribute specifies the short hint that describes the expected value of an input field. The short hint is displayed in the field before the user enters a value.

How do I add a red placeholder in HTML?

Try it Yourself » Step 1) Add HTML: Use an input element and add the placeholder attribute: Example <input type="text" placeholder="A red placeholder text.."> Step 2) Add CSS: In most browsers, the placeholder text is grey. To change this, style the placeholder with the non-standard ::placeholderselector.

What is the color of the placeholder in MSM input?

:-ms-input-placeholder { /* Internet Explorer 10-11 */ color: red; ::-ms-input-placeholder { /* Microsoft Edge */ color: red; Try it Yourself » Tip:Read more about the ::placeholder selector in our CSS Reference: CSS ::placeholder Property.


1 Answers

It's apparently a bug:

  • Firefox 29.0 the ::-moz-placeholder css pseudo-element selector is not honored for with type="number"

However, it seems to actually work for some users...

like image 120
Álvaro González Avatar answered Oct 11 '22 12:10

Álvaro González