-webkit-text-security
Non-standard: This feature is not standardized. We do not recommend using non-standard features in production, as they have limited browser support, and may change or be removed. However, they can be a suitable alternative in specific cases where no standard option exists.
-webkit-text-security là một thuộc tính CSS không chuẩn che giấu các ký tự trong trường <form> (chẳng hạn <input> hoặc <textarea>) bằng cách thay thế chúng bằng một hình dạng. Nó chỉ ảnh hưởng đến các trường không có type=password.
Cú pháp
css
-webkit-text-security: circle;
-webkit-text-security: disc;
-webkit-text-security: square;
-webkit-text-security: none;
/* Giá trị toàn cục */
-webkit-text-security: inherit;
-webkit-text-security: initial;
-webkit-text-security: revert;
-webkit-text-security: revert-layer;
-webkit-text-security: unset;
Cú pháp hình thức
-webkit-text-security =
circle |
disc |
square |
none
Ví dụ
>Che giấu nội dung ô nhập văn bản
Hãy thử gõ vào trường bên dưới. Nếu trình duyệt của bạn hỗ trợ thuộc tính này, các ký tự sẽ được thay thế bằng hình vuông.
HTML
html
<label for="name">Name:</label> <input type="text" name="name" id="name" />
CSS
css
input {
-webkit-text-security: square;
}
Kết quả
Đặc tả
Không thuộc bất kỳ tiêu chuẩn nào.