Coolest Guides on the Planet

coolest guides on the planet

Coolest Guides On The Planet

  • Home
  • macOS
  • WebDev
  • All Posts
  • Contact

Style The Placeholder Text in Input Fields in Forms with CSS

January 2, 2014 2 Comments

With CSS you can change the style of placeholder text in form and search fields, the placeholder HTML 5 form attribute is supported in the latest browser versions, how you get text pre-populated in an input field and use the placeholder attribute is explained here.

You can change how the placeholder text style looks in the browser  via CSS by default using the ::input-placeholder pseudo selector…


By default the CSS styling in browsers is a small font with a light grey coloring,  you can change this by using the CSS dynamic pseudo selectors, which will cover the major browsers Safari, Chrome, Firefox and IE…

::-webkit-input-placeholder {
 font-size: 14px;
 color: #d0cdfa;
 text-transform: uppercase;
 text-transform: uppercase;
 text-align: center;
 font-weight: bold;
}
:-moz-placeholder { /* older Firefox*/
 font-size:14px;
 color: #d0cdfa;
 text-transform: uppercase;
 text-align: center;
 font-weight: bold;
}
::-moz-placeholder { /* Firefox 19+ */ 
 font-size: 14px;
 color: #d0cdfa; 
 text-transform: uppercase;
 text-align: center;
 font-weight: bold;
} 
:-ms-input-placeholder { 
 font-size: 14px; 
 color: #d0cdfa;
 text-transform: uppercase;
 text-align: center;
 font-weight: bold;
}

So in the example above a few of the CSS rules are restyling the default text font size, color and alignment.

The CSS style properties you can use with input-placeholder are:

  • color
  • font-size
  • font-style
  • font-weight
  • letter-spacing
  • line-height
  • padding
  • text-align
  • text-decoration

You may need to add in the !important declaration to override some of the browsers settings.

For the regular input field text styling just use the input element.

Placeholder text is not supported on IE8 and earlier however including a polyfil javascript solution can support those browsers. I have also created a plugin for its use in WordPress.

Cats: WebDev

Tags

3gs 10.6 apache backup baseband boot clean urls cpanel css curl custom database drupal el capitan git Google image instadmg ios iphone jailbreak keys lion mac macos mojave macos sierra menu mysql OSX panda php phpmyadmin private public redirect redsn0w remote rsa SEO shell ssh terminal unstoppables upgrade urls

Donate a Beer to the Coolest Guides

Get Beaver Builder Now!

Discuss

3gs 10.6 apache backup baseband boot clean urls cpanel css curl custom database drupal el capitan git Google image instadmg ios iphone jailbreak keys lion mac macos mojave macos sierra menu mysql OSX panda php phpmyadmin private public redirect redsn0w remote rsa SEO shell ssh terminal unstoppables upgrade urls
Get DesktopServer

Lynda

Lynda.com Online Training Videos

TreeHouse

smlinks

Learn WordPress
osx-modify-shell-path

How to Add to the Shell Path in macOS Big Sur and Catalina using Terminal

October 19, 2019

virtual-hosts osx 10.10 yosemite

Set up Virtual Hosts on macOS Catalina 10.15 in Apache

October 19, 2019

Installing Homebrew on macOS Catalina 10.15, Package Manager for Linux Apps

October 18, 2019

Where is the bash shell in macos Catalina?

October 12, 2019

Refine your search

  • All
  • Modules
  • Themes
  • Documentation
  • Forums & Issues
  • Groups

RSS feed: ars technica ars technica

  • Command-line tool quickly removes Apple Intelligence from macOS 27
  • Review: The iPhone 18 Pro is Apple's coolest smartphone (but only literally)
  • Review: Apple's hyper-pricey M5 Ultra Mac Studio made me into a vibe coder
  • Apple Mac mini review: The new M6 impresses, but the price hike is rough
  • Apple reportedly building server packed with M-series Ultra chips for AI

RSS feed: mac surfer mac surfer

  • Apple TV 4K Rumored to Support Four HomePods for Surround Sound
  • Apple Plans Two October Product Launch Windows
  • Apple Opens iPhone Duo App Submissions to Developers
  • Apple Music Debuts Redesigned Logo
  • Apple Releases iOS 27.2, macOS 27.2 Beta 3

Donate

Copyright © 2026· Neil Gee - All Rights Reserved - Hosted by Runcloud

Copyright © 2026 · gee on Genesis Framework · WordPress · Log in