---
title: '::-ms-clear'
slug: 'Web/CSS/::-ms-clear'
tags:
- CSS
- Non-standard
- Pseudo-element
- Reference
translation_of: 'Archive/Web/CSS/::-ms-clear'
---
{{CSSRef}}{{Non-standard_header}}
Le pseudo-élément ::-ms-clear
représente le bouton qui permet d'effacer la valeur saisie dans un champ {{HTMLElement("input")}}. Ce bouton et ce pseudo-élément ne sont pas standards et sont uniquement pris en charge par Internet Explorer 10, 11 et Edge. Le bouton est uniquement affichés pour les champs textuels {{HTMLElement("input")}} non-vides et qui ont le focus.
Le bouton de remise à zéro est uniquement affiché pour les contrôles textuels qui ont le focus et qui ne sont pas vides. Les contrôles concernés sont :
- {{HTMLElement("input/color", '
<input type="color">
')}}
- {{HTMLElement("input/date", '
<input type="date">
')}}
- {{HTMLElement("input/datetime", '
<input type="datetime">
')}}
- {{HTMLElement("input/datetime-local", '
<input type="datetime-local">
')}}
- {{HTMLElement("input/email", '
<input type="email">
')}}
- {{HTMLElement("input/month", '
<input type="month">
')}}
- {{HTMLElement("input/number", '
<input type="number">
')}}
- {{HTMLElement("input/search", '
<input type="search">
')}}
- {{HTMLElement("input/tel", '
<input type="tel">
')}}
- {{HTMLElement("input/time", '
<input type="time">
')}}
- {{HTMLElement("input/url", '
<input type="url">
')}}
- {{HTMLElement("input/week", '
<input type="week">
')}}
Propriétés autorisées
Seules les propriétés CSS suivantes peuvent être utilisées dans une règle qui contient ::-ms-clear
dans son sélecteur (les autres propriétés seront ignorées).
- {{CSSxRef("-ms-high-contrast-adjust")}}
- {{CSSxRef("background-clip")}}
- {{CSSxRef("background-color")}}
- {{CSSxRef("background-image")}}
- {{CSSxRef("background-origin")}}
- {{CSSxRef("background-position-x")}}
- {{CSSxRef("background-position-y")}}
- {{CSSxRef("background-repeat")}}
- {{CSSxRef("background-size")}}
- {{CSSxRef("border-bottom-color")}}
- {{CSSxRef("border-bottom-left-radius")}}
- {{CSSxRef("border-bottom-right-radius")}}
- {{CSSxRef("border-bottom-style")}}
- {{CSSxRef("border-bottom-width")}}
- {{CSSxRef("border-left-color")}}
- {{CSSxRef("border-left-style")}}
- {{CSSxRef("border-left-width")}}
- {{CSSxRef("border-right-color")}}
- {{CSSxRef("border-right-style ")}}
- {{CSSxRef("border-right-width")}}
- {{CSSxRef("border-top-color")}}
- {{CSSxRef("border-top-left-radius")}}
- {{CSSxRef("border-top-right-radius ")}}
- {{CSSxRef("border-top-style")}}
- {{CSSxRef("border-top-width")}}
- {{CSSxRef("box-shadow")}}
- {{CSSxRef("box-sizing")}}
- {{CSSxRef("color")}}
- {{CSSxRef("cursor")}}
- {{CSSxRef("display")}} (avec les valeurs
block
, inline-block
, none
)
- {{CSSxRef("@font-face")}}
- {{CSSxRef("font-size")}}
- {{CSSxRef("font-style")}}
- {{CSSxRef("font-weight")}}
- {{CSSxRef("height")}}
- {{CSSxRef("margin-bottom")}}
- {{CSSxRef("margin-left")}}
- {{CSSxRef("margin-right")}}
- {{CSSxRef("margin-top")}}
- {{CSSxRef("opacity")}}
- {{CSSxRef("outline-color")}}
- {{CSSxRef("outline-style")}}
- {{CSSxRef("outline-width")}}
- {{CSSxRef("padding-bottom")}}
- {{CSSxRef("padding-left")}}
- {{CSSxRef("padding-right")}}
- {{CSSxRef("padding-top")}}
- {{CSSxRef("transform")}}
- {{CSSxRef("transform-origin")}}
- {{CSSxRef("visibility")}}
- {{CSSxRef("width")}}
Syntaxe
selecteur::-ms-clear
Exemples
CSS
input,
label {
display: block;
}
input[type=text]::-ms-clear {
color: red; /* La croix du bouton sera rouge. */
/* On peut cacher la croix avec display qui vaut "none" */
}
HTML
<form>
<label for="firstname">First name:</label>
<input type="text" id="firstname" name="firstname" placeholder="First name"><br>
<label for="lastname">Last name:</label>
<input type="text" id="lastname" name="lastname" placeholder="Second name">
</form>
Résultat
{{EmbedLiveSample('Exemples')}}
Voici une capture d'écran du résultat obtenu avec IE 10/11 :
![](https://mdn.mozillademos.org/files/12263/ms-clear-example.png)
Spécifications
Ce pseudo-élément est un pseudo-élément propriétaire lié à Trident/Microsoft et ne fait partie d'aucune spécification.
Compatibilité des navigateurs
Le tableau de compatibilité de cette page a été généré à partir de données structurées. Si vous souhaitez contribuer à ces données, n'hésitez pas à consulter
https://github.com/mdn/browser-compat-data et à nous envoyer une
pull request.
{{Compat("css.selectors.-ms-clear")}}