From 4b1a9203c547c019fc5398082ae19a3f3d4c3efe Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:41:15 -0500 Subject: initial commit --- files/ca/web/css/_colon_read-write/index.html | 98 +++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 files/ca/web/css/_colon_read-write/index.html (limited to 'files/ca/web/css/_colon_read-write') diff --git a/files/ca/web/css/_colon_read-write/index.html b/files/ca/web/css/_colon_read-write/index.html new file mode 100644 index 0000000000..434094c2ef --- /dev/null +++ b/files/ca/web/css/_colon_read-write/index.html @@ -0,0 +1,98 @@ +--- +title: ':read-write' +slug: 'Web/CSS/:read-write' +tags: + - CSS + - Layout + - Pseudo-class + - Reference + - Web +translation_of: 'Web/CSS/:read-write' +--- +
{{CSSRef}}
+ +

La pseudo-class CSS :read-write representa un element (com ara una entrada de text) que l'usuari pot editar.

+ +
/* Selecciona qualsevol element <input> que sigui editable Compatible amb Firefox amb un prefix */
+input:-moz-read-write {
+  background-color: #bbf;
+}
+
+/* Compatible amb Blink / WebKit / Edge sense un prefix */
+input:read-write {
+  background-color: #bbf;
+}
+ +
+

Nota: Aquest selector no només selecciona el text {{htmlElement("input")}} s; seleccionarà qualsevol element que l'usuari pugui editar, com ara un element {{htmlelement("p")}} amb {{htmlattrxref("contenteditable")}} establert en ell.

+
+ +

Sintaxi

+ +
{{csssyntax}}
+ +

Exemple

+ +

HTML

+ +
<input type="text" value="Type whatever you want here.">
+<input type="text" value="This is a read-only field." readonly>
+<p>This is a normal paragraph.</p>
+<p contenteditable="true">You can edit this paragraph!</p>
+ +

CSS

+ +
input { min-width: 25em; }
+input:-moz-read-write { background: cyan; }
+input:read-write { background: cyan; }
+
+p:-moz-read-write { background: lightgray; }
+p:read-write { background: lightgray; }
+p[contenteditable="true"] { color: blue; }
+
+ +

Resultat

+ +

{{EmbedLiveSample("Example")}}

+ +

Especificacions

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
EspecificacióEstatComentari
{{ SpecName('HTML WHATWG', '#selector-read-write', ':read-write') }}{{ Spec2('HTML WHATWG') }}Sense canvis.
{{ SpecName('HTML5 W3C', '#selector-read-write', ':read-write') }}{{ Spec2('HTML5 W3C') }}Defineix la semàntica respecte a HTML i la validació de restriccions.
{{ SpecName('CSS4 Selectors', '#rw-pseudos', ':read-write') }}{{ Spec2('CSS4 Selectors') }}Defineix la pseudo-classe, però no la semàntica associada.
+ +

Navegadors compatibles

+ + + +

{{Compat("css.selectors.read-write")}}

+ +

Vegeu també

+ + -- cgit v1.2.3-54-g00ecf