Need help on changing the text field color inside a form

Hi there,

Placeholder text is styled by the browser.

The code of an input is approximately that:

<form id="first-form">
<input id="email-form" placeholder="Enter your name" maxlength="256">
</form>

You can reach the placeholder text and style it using a pseudo-class :placeholder. So like this:

input:placeholder

In order to constraint the changes to the specific element, you can set it like this:

form#email-form input:placeholder

So final code can be something like this:

<style>
form#email-form input:placeholder { color:red; font-weight:700; }
<style>

And you put that in the section of the custom code tab of your sites’ settings. (or at page level) (Of course you change email-form to the ID you gave to the form, or only use form input:placeholder to impact all forms on the site.)

1 Like