Martin Costello
Martin Costello

Reputation: 10862

Remove 'x' Input Decoration In Microsoft Edge (formerly Project Spartan)

In the CSS of a website I'm currently working on we use the following CSS to hide the 'x' button that Internet Explorer 10 and 11 add to input fields for users to clear their contents:

input::-ms-clear {
  display: none;
}

Viewing the same website in the first build of Microsoft Edge (formerly codenamed "Project Spartan") on Windows 10 Build 10049 this CSS has no effect. This isn't surprising as Microsoft Edge is breaking away from the legacy of Internet Explorer, but I want to achieve the same effect.

What is the equivalent CSS required for Microsoft Edge to not render this?

Upvotes: 39

Views: 18225

Answers (3)

I have tried the solutions provided here, I am in 2025 and it does not work try this instead..

[type='search']::-webkit-search-cancel-button,
[type='search']::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
}

Found on davidwalsh.name. Thank to David Walsh

Upvotes: 1

Karuppiah RK
Karuppiah RK

Reputation: 3964

Also you can use type="text" in input field to remove that X

Upvotes: 2

Martin Costello
Martin Costello

Reputation: 10862

It turns out that the CSS had been broken since it was originally written, and this wasn't working in IE 10+ either.

Since fixing the CSS, Microsoft Edge (formerly Project Spartan) is behaving the same as IE10+ and not displaying the 'x' in input fields.

Upvotes: 27

Related Questions