Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I change placeholder font size for bootstrap and bootstrap material design?

My jsfiddle here has links to bootstrap and bootstrap material design. I want to make the font for the input placeholder smaller but it just doesn't budget, even with input-placeholder for moz or webkit. Any suggestions would be greatly appreciated.

html

<form class="form form-group has-info col-md-4">
      <input class="search-input form-control" placeholder=" . . . enter pokemon name" type="text">
      <button type="submit" class="btn btn-info btn-raised " name="button">Search!</button>
 </form>

css

::-webkit-input-placeholder {
   font-size: 25px;
}

:-moz-placeholder { /* Firefox 18- */
      font-size: 25px;
}

::-moz-placeholder {  /* Firefox 19+ */
      font-size: 25px;
}

:-ms-input-placeholder {
      font-size: 25px;
}
like image 785
stackjlei Avatar asked Sep 07 '16 04:09

stackjlei


People also ask

How do I change the size of a placeholder?

To resize a placeholder: Click inside the placeholder. The border changes to sizing handles. Move the pointer over the sizing handles and a + appears. Click and drag the placeholder to the size you want.

Can I style the placeholder text?

Definition and Usage. The ::placeholder selector selects form elements with placeholder text, and let you style the placeholder text. The placeholder text is set with the placeholder attribute, which specifies a hint that describes the expected value of an input field.

How do I change the placeholder font in CSS?

In most browsers, the placeholder text is grey. To change this, style the placeholder with the non-standard ::placeholder selector.

How do I make the font bigger in bootstrap?

Responsive font sizes RFS can be enabled by changing the $enable-responsive-font-sizes Sass variable to true and recompiling Bootstrap. To support RFS , we use a Sass mixin to replace our normal font-size properties.


1 Answers

Add !important to override the styles

::-webkit-input-placeholder {
   font-size: 25px;
}

:-moz-placeholder { /* Firefox 18- */
      font-size: 25px;
}

::-moz-placeholder {  /* Firefox 19+ */
      font-size: 25px;
}

/* Overriding styles */

::-webkit-input-placeholder {
   font-size: 13px!important;
}

:-moz-placeholder { /* Firefox 18- */
      font-size: 13px!important;
}
::-moz-placeholder {  /* Firefox 19+ */
      font-size: 13px!important;
}
<input type="text" placeholder="Example..">
like image 128
Hitesh Misro Avatar answered Sep 29 '22 21:09

Hitesh Misro