الفرق بين المراجعتين ل"CSS/:read-write"
< CSS
اذهب إلى التنقل
اذهب إلى البحث
ط (استبدال النص - '\[\[تصنيف:(.*)\]\]' ب'{{SUBPAGENAME}}') |
|||
سطر 20: | سطر 20: | ||
<input type="text" value="Type whatever you want here."> | <input type="text" value="Type whatever you want here."> | ||
<input type="text" value="This is a read-only field." readonly> | <input type="text" value="This is a read-only field." readonly> | ||
− | <p> | + | <p>هذه فقرة عادية</p> |
− | <p contenteditable="true"> | + | <p contenteditable="true">يمكنك تحرير هذه الفقرة</p> |
</syntaxhighlight>شيفرة CSS:<syntaxhighlight lang="css"> | </syntaxhighlight>شيفرة CSS:<syntaxhighlight lang="css"> |
مراجعة 10:10، 11 أكتوبر 2018
الصنف الزائف :read-write
في CSS (أي pseudo-class) يُمثِّل أي عنصر فيه محتوى نصي يمكن للمستخدم تعديله.
/* يجب توفير سابقة لمتصفح فايرفكس */
input:-moz-read-write {
background-color: #bbf;
}
input:read-write {
background-color: #bbf;
}
لاحظ أنَّ هذا المُحدِّد لا يُحدِّد عناصر <input>
فقط، وإنما يُحدِّد أي عنصر يمكن للمستخدم تعديله، مثل عناصر <p>
التي ضُبِطَت الخاصية contenteditable
عليها.
الشكل العام لهذا المحدد:
:read-write
أمثلة
مثال عن استخدام هذا الصنف لتحديد جميع العناصر التي يمكن تعديلها:
<input type="text" value="Type whatever you want here.">
<input type="text" value="This is a read-only field." readonly>
<p>هذه فقرة عادية</p>
<p contenteditable="true">يمكنك تحرير هذه الفقرة</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; }
دعم المتصفحات
الميزة | Chrome | Firefox | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
الدعم الأساسي | مدعومة | مدعومة لكن مع السابقة -moz-
|
مدعومة | مدعومة | مدعومة |
مصادر ومواصفات
- معيار HTML Living Standard.
- مواصفة HTML5.
- مسودة Selectors Level 4.