diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:42:52 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:42:52 -0500 |
commit | 074785cea106179cb3305637055ab0a009ca74f2 (patch) | |
tree | e6ae371cccd642aa2b67f39752a2cdf1fd4eb040 /files/pt-br/web/css/_colon_out-of-range | |
parent | da78a9e329e272dedb2400b79a3bdeebff387d47 (diff) | |
download | translated-content-074785cea106179cb3305637055ab0a009ca74f2.tar.gz translated-content-074785cea106179cb3305637055ab0a009ca74f2.tar.bz2 translated-content-074785cea106179cb3305637055ab0a009ca74f2.zip |
initial commit
Diffstat (limited to 'files/pt-br/web/css/_colon_out-of-range')
-rw-r--r-- | files/pt-br/web/css/_colon_out-of-range/index.html | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/files/pt-br/web/css/_colon_out-of-range/index.html b/files/pt-br/web/css/_colon_out-of-range/index.html new file mode 100644 index 0000000000..56ab889b6e --- /dev/null +++ b/files/pt-br/web/css/_colon_out-of-range/index.html @@ -0,0 +1,111 @@ +--- +title: ':out-of-range' +slug: 'Web/CSS/:out-of-range' +translation_of: 'Web/CSS/:out-of-range' +--- +<div>{{CSSRef}}</div> + +<p>A <a href="/en-US/docs/CSS/Pseudo-classes" title="Pseudo-classes">pseudo classe</a> de <a href="/en-US/docs/Web/CSS">CSS</a> <strong><code>:out-of-range</code></strong> representa um elemento de {{htmlelement("entrada")}} cujo valor atual esta fora dos limites especificados pelo {{htmlattrxref("min", "entrada")}} e {{htmlattrxref("max","entrada")}} atributos</p> + +<pre class="brush: css no-line-numbers">/* Selecione qualquer <entrada>, mas somente quando estiver dentros dos + limites especificados, e quando este valor estiver fora deste limite */ +input:out-of-range { + background-color: rgba(255, 0, 0, 0.25); +}</pre> + +<p>Essa pseudo classe é muito útil por dar ao usuario uma indicacão visual de que o valor atual esta fora dos limites permitidos</p> + +<div class="note"><strong>Nota:</strong> Esta pseudo classe se aplica somente a elementos que tem (ou podem ter) uma limitacao. Na falta dessa de algo como essa limitacao, o elemento nao tera como ficar "in-range"(dentro dos limites) ou "out-of-range" (fora dos limites).</div> + +<h2 id="Sintaxe">Sintaxe</h2> + +<pre class="syntaxbox">{{csssyntax}}</pre> + +<h2 id="Example" name="Example">Exemplo</h2> + +<div id="example"> +<h3 id="HTML">HTML</h3> + +<pre class="brush: html"><form action="" id="form1"> + <p>Valores entre 1 e 10 são validos.</p> + <ul> + <li> + <input id="value1" name="value1" type="number" placeholder="1 to 10" min="1" max="10" value="12"> + <label for="value1">Seu valor está </label> + </li> + </ul> +</form></pre> + +<h3 id="CSS">CSS</h3> + +<pre class="brush: css;">li { + list-style: none; + margin-bottom: 1em; +} + +input { + border: 1px solid black; +} + +input:in-range { + background-color: rgba(0, 255, 0, 0.25); +} + +input:out-of-range { + background-color: rgba(255, 0, 0, 0.25); + border: 2px solid red; +} + +input:in-range + label::after { + content: 'dentro dos limites.'; +} + +input:out-of-range + label::after { + content: 'Fora dos limites!'; +}</pre> + +<h3 id="Resultado">Resultado</h3> +</div> + +<div>{{EmbedLiveSample('Example', 600, 140)}}</div> + +<h2 id="Specifications"><span>Specifications</span></h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{SpecName('HTML WHATWG', 'scripting.html#selector-out-of-range', ':out-of-range')}}</td> + <td>{{Spec2('HTML WHATWG')}}</td> + <td>Define quando <code>:out-of-range</code> se iguala aos elementos em HTML.</td> + </tr> + <tr> + <td>{{SpecName('CSS4 Selectors', '#out-of-range-pseudo', ':out-of-range')}}</td> + <td>{{Spec2('CSS4 Selectors')}}</td> + <td>Definicao inicial.</td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility">Browser compatibility</h2> + +<div> +<div> + + +<p>{{Compat("css.selectors.out-of-range")}}</p> +</div> +</div> + +<h2 id="See_also">See also</h2> + +<ul> + <li>{{cssxref(":in-range")}}</li> + <li><a href="/en-US/docs/Learn/HTML/Forms/Form_validation">Form data validation</a></li> +</ul> |