{"id":5677,"date":"2024-12-02T09:40:27","date_gmt":"2024-12-02T09:40:27","guid":{"rendered":"https:\/\/ubiq.co\/tech-blog\/?p=5677"},"modified":"2024-12-02T09:51:53","modified_gmt":"2024-12-02T09:51:53","slug":"how-to-change-html-inputs-placeholder-color-with-css","status":"publish","type":"post","link":"https:\/\/ubiq.co\/tech-blog\/how-to-change-html-inputs-placeholder-color-with-css\/","title":{"rendered":"How to Change HTML Input&#8217;s Placeholder Color with CSS"},"content":{"rendered":"\n<p>Typically, input textboxes and textarea display default text in grey font color. This text is also known as placeholder text. The placeholder color is the default color of text displayed in textboxes and textarea. Sometimes web developers need to change HTML input&#8217;s placeholder color with CSS. There are several ways to customize font color of HTML inputs. In this article, we will learn how to change placeholder color of HTML input textbox and textarea using plain CSS. You don&#8217;t need any JavaScript for this purpose.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-change-html-inputs-placeholder-color-with-css\/#How_to_Change_HTML_Inputs_Placeholder_Color\" >How to Change HTML Input&#8217;s Placeholder Color<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-change-html-inputs-placeholder-color-with-css\/#1_Most_Modern_Web_Browsers\" >1. Most Modern Web Browsers<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-change-html-inputs-placeholder-color-with-css\/#2_Browser_Specific_Solution\" >2. Browser Specific Solution<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-change-html-inputs-placeholder-color-with-css\/#3_Element_Specific_Solution\" >3. Element Specific Solution<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-change-html-inputs-placeholder-color-with-css\/#Important_Note\" >Important Note<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-change-html-inputs-placeholder-color-with-css\/#Conclusion\" >Conclusion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-change-html-inputs-placeholder-color-with-css\/#FAQ\" >FAQ<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_Change_HTML_Inputs_Placeholder_Color\"><\/span>How to Change HTML Input&#8217;s Placeholder Color<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>There are two ways to change HTML input&#8217;s placeholder color &#8211; using pseudo-element and using pseudo-class. Let us understand what is meant by pseudo element and pseudo class.<\/p>\n\n\n\n<p><strong>Pseudo element<\/strong> : <a href=\"https:\/\/www.w3schools.com\/css\/css_pseudo_elements.asp\" target=\"_blank\" rel=\"noreferrer noopener\">Pseudo elements<\/a> are keywords added to CSS selector that allow you to select and style specific parts of the HTML element, instead of styling the entire element. They are commonly used to style first letter of text in a paragraph or set placeholder color in input elements.<\/p>\n\n\n\n<p><strong>Pseudo class<\/strong> : Pseudo class is a special state of an HTML element that is often used to style the element. For example, you can use pseudo class to change the color of anchor link, on mouse hover.<\/p>\n\n\n\n<p>Let us say you have the following HTML input text box.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;input type=\"text\" placeholder=\"hello world\"&gt;<\/pre>\n\n\n\n<p>When you run the web page with above code, it will most probably display the placeholder text in grey color. This is the default font color for placeholder text in most browsers. Let us look at the different ways to change this font color.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_Most_Modern_Web_Browsers\"><\/span>1. Most Modern Web Browsers<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Most modern web browsers support a ::placeholder pseudo-element that allows you to select and style only the placeholder text of CSS input. Here is the code to change the HTML input&#8217;s placeholder color to red.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">input::placeholder{<br>  color:red;<br>}<br><br>OR<br><br>::placeholder{<br>  color:red;<br>}<\/pre>\n\n\n\n<p>The above code will select and style only the text mentioned as placeholder attribute of input text and textarea. <\/p>\n\n\n\n<p>Also, it will change the placeholder color of all text input on your web page, whether it is a textbox or textarea. If you only want to change color of specific text input, then you can customize your CSS selector. Here is an example to change placeholder color of input which accepts email address.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">input[type=\"email\"]::placeholder { <br>        color: red; <br>    } <\/pre>\n\n\n\n<p>Here are code snippets to change placeholder colors for password input.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">input[type=\"email\"]::placeholder { <br>        color: red; <br>    } <\/pre>\n\n\n\n<p>If you have a textrarea on your page, then you will need to use textarea tag in your CSS selector, instead of input. Let us say you have the following textarea.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;textarea id=\"my_text\" placeholder=\"hello, good morning\" &gt;<br>&lt;\/textarea&gt;<\/pre>\n\n\n\n<p>Here is the CSS to change its placeholder font color.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">textarea::placeholder{<br>  color:red;<br>}<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Browser_Specific_Solution\"><\/span>2. Browser Specific Solution<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The above solution should work in most Chrome, Firefox, Opera and Edge versions. However, if you are using older web browsers, or the above solution does not work on your web browser, then you can try a web browser specific solution.<\/p>\n\n\n\n<p>Safari, Chrome, Opera 15+ use pseudo-element ::webkit-input-placeholder. Firefox versions 4 to 18 support pseudo-class :-moz-placeholder whereas Firefox 19+ support pseudo element ::-moz-placeholder. Internet explorer and Edge support pseudo element ::-ms-input-placeholder.<\/p>\n\n\n\n<p>IE older than 9 and Opera older than version 12 do not support any placeholder selectors.<\/p>\n\n\n\n<p>Here is a more browser-specific solution to support various web browsers.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">::-webkit-input-placeholder { \/* WebKit, Blink, Edge *\/<br>    color:    red;<br>}<br>:-moz-placeholder { \/* Mozilla Firefox 4 to 18 *\/<br>   color:    red;<br>}<br>::-moz-placeholder { \/* Mozilla Firefox 19+ *\/<br>   color:    red;<br>}<br>:-ms-input-placeholder { \/* Internet Explorer 10-11 *\/<br>   color:    red;<br>}<br>::-ms-input-placeholder { \/* Microsoft Edge *\/<br>   color:    red;<br>}<\/pre>\n\n\n\n<p>If you want, you can also add ::placeholder selector&#8217;s styling, shown in previous solution, to the above code to make it more comprehensive. But please do not combine the above CSS selectors because if one selector does not work, then the rest in the group will also fail.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_Element_Specific_Solution\"><\/span>3. Element Specific Solution<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>If there are multiple input elements or textarea then you need to be more specific with your selectors otherwise all placeholder texts will be formatted unnecessarily. Here is an example to change placeholder text color for only text inputs.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">input[type=\"text\"]::placeholder {<br>    color: red;<br>}<br><br>OR<br><br>input[type=\"text\"]::-webkit-input-placeholder {<br>    color: red;<br>}<\/pre>\n\n\n\n<p>Here is an example to change color of placeholder text for input with id=my_text.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#my_text::placeholder {<br>    color: red;<br>}<\/pre>\n\n\n\n<p>Here is an example to change placeholder color of text inputs with class=text_input.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">.text_input::placeholder {<br>    color: red;<br>}<\/pre>\n\n\n\n<p>Here is the code to change color of characters in password text box.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">input[type=\"password\"]::placeholder {<br>    color: red;<br>}<\/pre>\n\n\n\n<p>Just by changing the CSS element selector, you can tweak where you want the placeholder formatting to be applied. In the above examples, we have only used pseudo-element ::placeholder. But you can also use browser specific pseudo elements instead.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Important_Note\"><\/span>Important Note<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Please note, this will not change the actual text color of input elements. For example, if you have changed the placeholder color to red then only the placeholder text will appear red. The moment you start typing in the HTML input, its color will automatically change to what you have set it to, or default black color. So if you also want to change the font color of input elements, you need to do that separately. If you want to change the actual font color of typed text in your input elements, then you need to add separate CSS rules for it. Here is the CSS code to change the actual font of input elements to CSS.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">input[type='text']{<br>  color:red;<br>}<br><br>OR<br><br>textarea{<br>  color:red;<br>}<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In this article, we have learnt several different ways to change the color of placeholder text in HTML text input as well as textarea. You can use any of these methods depending on your requirements. If your users use modern web browsers such as Edge, Chrome, Firefox, then you can use ::placeholder pseudo-element. If it is not supported by your web browser, then you can also try using pseudo-element ::webkit-input-placeholder (Safari, Chrome, Opera 15+), ::-moz-placeholder (Firefox) and ::-ms-input-placeholder (Internet explorer and Edge). You can also use a combination of both these approaches so that it is more comprehensive.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"FAQ\"><\/span>FAQ<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><strong>1. Will it also change the font color of input elements?<\/strong><\/p>\n\n\n\n<p>No. It will only change the HTML input&#8217;s placeholder color. The moment you start typing input text, it will switch the font color of input text box or textarea. If you also want to change font color of actual user input, then you need to add separate CSS rules for it, as mentioned above.<\/p>\n\n\n\n<p><strong>2. Is it supported on all web browsers?<\/strong><\/p>\n\n\n\n<p>The ::placeholder pseudo-element is supported by most modern web browsers. If it is not working on your web browser, then you can try using use pseudo-element ::webkit-input-placeholder for Safari, Chrome, Opera 15+, ::-moz-placeholder for Firefox and ::-ms-input-placeholder for Internet explorer and Edge.<\/p>\n\n\n\n<p>Also read:<\/p>\n\n\n\n<p><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-detect-click-outside-element-in-javascript\/\">How to Detect Click Outside Element in JavaScript<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-know-which-radio-button-is-selected-via-jquery\/\">How to Know Which Radio Button is Selected in jQuery<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-javascript-closures-work\/\">How JavaScript Closures Work<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes web developers need to change placeholder color of input text and textarea. Here is how to change HTML input&#8217;s placeholder color in CSS.<\/p>\n","protected":false},"author":1,"featured_media":5708,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[340],"tags":[341],"class_list":["post-5677","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-css","tag-input-placeholder"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Change HTML Input&#039;s Placeholder Color with CSS - Ubiq BI<\/title>\n<meta name=\"description\" content=\"Often web developers need to change placeholder color of input text &amp; textarea. Here is how to change HTML input&#039;s placeholder color in CSS.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-change-html-inputs-placeholder-color-with-css\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Change HTML Input&#039;s Placeholder Color with CSS - Ubiq BI\" \/>\n<meta property=\"og:description\" content=\"Often web developers need to change placeholder color of input text &amp; textarea. Here is how to change HTML input&#039;s placeholder color in CSS.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ubiq.co\/tech-blog\/how-to-change-html-inputs-placeholder-color-with-css\/\" \/>\n<meta property=\"og:site_name\" content=\"Ubiq BI\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ubiqbi\" \/>\n<meta property=\"article:published_time\" content=\"2024-12-02T09:40:27+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-12-02T09:51:53+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2024\/12\/change-html-input-color-css.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"260\" \/>\n\t<meta property=\"og:image:height\" content=\"173\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Sreeram Sreenivasan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@UbiqBI\" \/>\n<meta name=\"twitter:site\" content=\"@UbiqBI\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sreeram Sreenivasan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-change-html-inputs-placeholder-color-with-css\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-change-html-inputs-placeholder-color-with-css\/\"},\"author\":{\"name\":\"Sreeram Sreenivasan\",\"@id\":\"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc\"},\"headline\":\"How to Change HTML Input&#8217;s Placeholder Color with CSS\",\"datePublished\":\"2024-12-02T09:40:27+00:00\",\"dateModified\":\"2024-12-02T09:51:53+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-change-html-inputs-placeholder-color-with-css\/\"},\"wordCount\":1056,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-change-html-inputs-placeholder-color-with-css\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2024\/12\/change-html-input-color-css.jpg?fit=260%2C173&ssl=1\",\"keywords\":[\"input placeholder\"],\"articleSection\":[\"CSS\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/ubiq.co\/tech-blog\/how-to-change-html-inputs-placeholder-color-with-css\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-change-html-inputs-placeholder-color-with-css\/\",\"url\":\"https:\/\/ubiq.co\/tech-blog\/how-to-change-html-inputs-placeholder-color-with-css\/\",\"name\":\"How to Change HTML Input's Placeholder Color with CSS - Ubiq BI\",\"isPartOf\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-change-html-inputs-placeholder-color-with-css\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-change-html-inputs-placeholder-color-with-css\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2024\/12\/change-html-input-color-css.jpg?fit=260%2C173&ssl=1\",\"datePublished\":\"2024-12-02T09:40:27+00:00\",\"dateModified\":\"2024-12-02T09:51:53+00:00\",\"author\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc\"},\"description\":\"Often web developers need to change placeholder color of input text & textarea. Here is how to change HTML input's placeholder color in CSS.\",\"breadcrumb\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-change-html-inputs-placeholder-color-with-css\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ubiq.co\/tech-blog\/how-to-change-html-inputs-placeholder-color-with-css\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-change-html-inputs-placeholder-color-with-css\/#primaryimage\",\"url\":\"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2024\/12\/change-html-input-color-css.jpg?fit=260%2C173&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2024\/12\/change-html-input-color-css.jpg?fit=260%2C173&ssl=1\",\"width\":260,\"height\":173,\"caption\":\"change html input color in css\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-change-html-inputs-placeholder-color-with-css\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/ubiq.co\/tech-blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Change HTML Input&#8217;s Placeholder Color with CSS\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ubiq.co\/tech-blog\/#website\",\"url\":\"https:\/\/ubiq.co\/tech-blog\/\",\"name\":\"Ubiq BI\",\"description\":\"Build dashboards &amp; reports in minutes\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/ubiq.co\/tech-blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc\",\"name\":\"Sreeram Sreenivasan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"caption\":\"Sreeram Sreenivasan\"},\"description\":\"Sreeram Sreenivasan is the Founder of Ubiq. He has helped many Fortune 500 companies in the areas of BI &amp; software development.\",\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/sreeram-sreenivasan\/\"],\"url\":\"https:\/\/ubiq.co\/tech-blog\/author\/wordpress\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Change HTML Input's Placeholder Color with CSS - Ubiq BI","description":"Often web developers need to change placeholder color of input text & textarea. Here is how to change HTML input's placeholder color in CSS.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ubiq.co\/tech-blog\/how-to-change-html-inputs-placeholder-color-with-css\/","og_locale":"en_US","og_type":"article","og_title":"How to Change HTML Input's Placeholder Color with CSS - Ubiq BI","og_description":"Often web developers need to change placeholder color of input text & textarea. Here is how to change HTML input's placeholder color in CSS.","og_url":"https:\/\/ubiq.co\/tech-blog\/how-to-change-html-inputs-placeholder-color-with-css\/","og_site_name":"Ubiq BI","article_publisher":"https:\/\/www.facebook.com\/ubiqbi","article_published_time":"2024-12-02T09:40:27+00:00","article_modified_time":"2024-12-02T09:51:53+00:00","og_image":[{"width":260,"height":173,"url":"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2024\/12\/change-html-input-color-css.jpg","type":"image\/jpeg"}],"author":"Sreeram Sreenivasan","twitter_card":"summary_large_image","twitter_creator":"@UbiqBI","twitter_site":"@UbiqBI","twitter_misc":{"Written by":"Sreeram Sreenivasan","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-change-html-inputs-placeholder-color-with-css\/#article","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-change-html-inputs-placeholder-color-with-css\/"},"author":{"name":"Sreeram Sreenivasan","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"headline":"How to Change HTML Input&#8217;s Placeholder Color with CSS","datePublished":"2024-12-02T09:40:27+00:00","dateModified":"2024-12-02T09:51:53+00:00","mainEntityOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-change-html-inputs-placeholder-color-with-css\/"},"wordCount":1056,"commentCount":0,"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-change-html-inputs-placeholder-color-with-css\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2024\/12\/change-html-input-color-css.jpg?fit=260%2C173&ssl=1","keywords":["input placeholder"],"articleSection":["CSS"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ubiq.co\/tech-blog\/how-to-change-html-inputs-placeholder-color-with-css\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-change-html-inputs-placeholder-color-with-css\/","url":"https:\/\/ubiq.co\/tech-blog\/how-to-change-html-inputs-placeholder-color-with-css\/","name":"How to Change HTML Input's Placeholder Color with CSS - Ubiq BI","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-change-html-inputs-placeholder-color-with-css\/#primaryimage"},"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-change-html-inputs-placeholder-color-with-css\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2024\/12\/change-html-input-color-css.jpg?fit=260%2C173&ssl=1","datePublished":"2024-12-02T09:40:27+00:00","dateModified":"2024-12-02T09:51:53+00:00","author":{"@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"description":"Often web developers need to change placeholder color of input text & textarea. Here is how to change HTML input's placeholder color in CSS.","breadcrumb":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-change-html-inputs-placeholder-color-with-css\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ubiq.co\/tech-blog\/how-to-change-html-inputs-placeholder-color-with-css\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-change-html-inputs-placeholder-color-with-css\/#primaryimage","url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2024\/12\/change-html-input-color-css.jpg?fit=260%2C173&ssl=1","contentUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2024\/12\/change-html-input-color-css.jpg?fit=260%2C173&ssl=1","width":260,"height":173,"caption":"change html input color in css"},{"@type":"BreadcrumbList","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-change-html-inputs-placeholder-color-with-css\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ubiq.co\/tech-blog\/"},{"@type":"ListItem","position":2,"name":"How to Change HTML Input&#8217;s Placeholder Color with CSS"}]},{"@type":"WebSite","@id":"https:\/\/ubiq.co\/tech-blog\/#website","url":"https:\/\/ubiq.co\/tech-blog\/","name":"Ubiq BI","description":"Build dashboards &amp; reports in minutes","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ubiq.co\/tech-blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc","name":"Sreeram Sreenivasan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","caption":"Sreeram Sreenivasan"},"description":"Sreeram Sreenivasan is the Founder of Ubiq. He has helped many Fortune 500 companies in the areas of BI &amp; software development.","sameAs":["https:\/\/www.linkedin.com\/in\/sreeram-sreenivasan\/"],"url":"https:\/\/ubiq.co\/tech-blog\/author\/wordpress\/"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2024\/12\/change-html-input-color-css.jpg?fit=260%2C173&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/pbGGTT-1tz","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/5677","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/comments?post=5677"}],"version-history":[{"count":37,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/5677\/revisions"}],"predecessor-version":[{"id":5719,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/5677\/revisions\/5719"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media\/5708"}],"wp:attachment":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media?parent=5677"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/categories?post=5677"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/tags?post=5677"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}