Change Placeholder Color using CSS

In this tutorial we will see how to Change Placeholder Color using CSS. ::placeholder CSS selector is used to target the placeholder text of input element and to change it's color.

HTML Code

HTML Code is given below, in this code we have a input tag with placeholder text.

<input type="text" placeholder="Name:">

CSS Code

CSS Code is given below, ::placeholder selector is used for Chrome, Firefox and Opera, while :ms-input-placeholder is used for Internet Explorer and ::ms-input-placeholder is used for Edge.

/* for Chrome and Firefox */
::placeholder
{
    color: #38B6FF;
    opacity: 1;
}

/* for Internet Explorer */

:ms-input-placeholder
{
    color: blue;
}

/* for Edge */

::ms-input-placeholder
{
    color: blue;
}

Demo

Video Tutorial

Watch our video tutorial on how to Change Placeholder Color using CSS.

Neumorphic Search Bar Design with HTML and CSS Simple Login Form with Placeholder Animation Pure CSS Button with Folded Corner Background Color Change Slider with HTML CSS and JavaScript 404 Page Not Found Template Design with HTML and CSS Movies Blog Card Design with HTML and CSS Simple CSS Border Animation with before and after Selector Custom Social Select Dropdown Menu with CSS and JavaScript Facebook Offline and Online Notification with CSS and JS New Year 2022 Text Animation with CSS and JS Change Placeholder Color using CSS Custom Select Tag DropDown with CSS and JavaScript Profile Card With Hover Effect using HTML and CSS Simple Price Range Slider With HTML CSS and JavaScript Circle With Two Colors using CSS Card With Ribbon using HTML and CSS Simple Loading Screen using HTML and CSS Disable Textarea Resizable Property using CSS Button like Links using CSS Simple Dropdown Menu Using HTML and CSS Background Color Transition using CSS Highlight Required Input Fields using CSS Disable HTML Link using CSS Difference Between Descendant Selector and Child Selector How To Change Color and Size of Hr Tag Using CSS How To Center Align HTML Table Convert Checkbox To Toggle Button Using CSS Drawing Stars using HTML and CSS Button Bounce Effect using CSS Image as Text Background using CSS background-clip Property Vertically Rotate HTML Element using CSS Vertical Align Middle using CSS Text Over Image Hover Effect - Css Hover Simple CSS Button Hover Effect using Before Selector