1

There is default clear button appear using search input below is html block of code

<div class="input-group search-style ">
                <input id="Search" class="form-control  border-secondary py-2 " type="search" placeholder="search" style="border-right: none !important;">
                <div class="input-group-append">
                    <button class="btn removefocus" type="button" style="border-top: 1px solid gray;
    border-right: 1px solid gray;
    border-bottom: 1px solid gray;">
                        <i class="fa fa-search "></i>
                    </button>
                </div>
            </div>

please see the output

default color of clear button is blue. How can i change this color on my search input.

Feroz Siddiqui
  • 3,840
  • 6
  • 34
  • 69

1 Answers1

4

The only way is to set the close icon's appearance to none, and use a background instead:

input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  background: some-image or svg;
}

https://jsfiddle.net/mLoeds3c/1/

mulsun
  • 563
  • 5
  • 15