Fixed bug with adding Firefox profile.

Why Firefox Doesn’t Accept Placeholder Text for Placeholder. see an example here http://jsfiddle.net/JfrfZ/

How to fix it?

HTML

<form method="get" action="/search" id="search">
  <input name="q" type="text" size="40" placeholder="Search..." />
</form>

CSS

#search input[type="text"] {
           background: url(../img/search-icon.png) no-repeat 2.6% 50% #fcfcfc;
               background-size: 6%;
               border: 1px solid #d1d1d1;
               font: normal 1.7em Arial,Helvetica,Sans-serif;
               color: #bebebe;
               width: 33%;
               padding: 0.6% 2%;
               border-radius: 3em;
               text-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
               box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) inset;
               padding-left: 3.8%;
                outline: 0; }
+5
source share
4 answers

You need to use ::-moz-placeholderpsuedo-element (previously :moz-placeholder).

 #search input::-moz-placeholder {
     padding: <top> <right> <bottom> <left>;
 }

There used to be a bug in Firefox that prevented padding from text inputs . So there text-indentwas a way to go if you needed to use interest.

#search input:-moz-placeholder {
    text-indent: 3.8%;     
}

But the error was fixed in 2012-08-28 and is included in Firefox 17. You no longer need to use it text-indent.

+8
source

text-indent

#search input[type="text"] {
    background: url(../img/search-icon.png) no-repeat 2.6% 50% #fcfcfc;
    background-size: 6%;
    border: 1px solid #d1d1d1;
    font: normal 1.7em Arial,Helvetica,Sans-serif;
    color: #bebebe;
    width: 33%;
    padding: 0.6% 2%;
    border-radius: 3em;
    text-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) inset;
    padding-left: 3.8%;
    outline: 0; 
    text-indent: 3.8%
}
<form method="get" action="/search" id="search">
  <input name="q" type="text" size="40" placeholder="Search..." />
</form>
Hide result
+4

padding-left :

text-indent:3.8%;
+2

padding: 0.6% 2%; input { }

0
source

All Articles