skip to Main Content

I have the following HTML Structure. I try to gray out the checkbox when readonly="readonly" is valid. Is there a good way to do that via CSS?

<input type="email" class="input-text " name="billing_email" id="billing_email" placeholder="" value="[email protected]" readonly="readonly" autocomplete="email username">

2

Answers


  1. You can use the disabled attribute instead of readonly, it sounds like it will do what you want.

    See this code fiddle

    Login or Signup to reply.
  2. you can try input[readonly] {
    color: gray
    }

    input[readonly] {
      color: gray;
    }
    <input type="email" class="input-text " name="billing_email" id="billing_email" placeholder="" value="[email protected]" readonly="readonly" autocomplete="email username">
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search