-moz-user-focus

Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

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.

Thuộc tính CSS -moz-user-focus được dùng để chỉ định liệu một phần tử có thể nhận focus hay không.

Bằng cách đặt giá trị thành ignore, bạn có thể vô hiệu hóa việc focus vào phần tử, nghĩa là người dùng sẽ không thể kích hoạt phần tử đó, và phần tử sẽ bị bỏ qua trong trình tự Tab. Giá trị mặc định là none, sẽ vô hiệu hóa focus vào phần tử và xóa focus khỏi các phần tử khác nếu có cố gắng chọn phần tử.

Cú pháp

css
/* Giá trị từ khóa */
-moz-user-focus: none;
-moz-user-focus: normal;
-moz-user-focus: ignore;

/* Giá trị toàn cục */
-moz-user-focus: inherit;
-moz-user-focus: initial;
-moz-user-focus: unset;

Giá trị

ignore

Phần tử không nhận focus từ bàn phím và sẽ bị bỏ qua trong thứ tự Tab.

normal

Phần tử có thể nhận focus từ bàn phím.

none

Phần tử không nhận focus từ bàn phím. Cố gắng chọn phần tử sẽ xóa focus khỏi bất kỳ phần tử nào khác.

Định nghĩa hình thức

Initial valuenone
Applies toall elements
Inheritedno
Computed valueas specified
Animation typediscrete

Cú pháp hình thức

-moz-user-focus = 
ignore |
normal |
none

Ví dụ

HTML

html
<input class="ignored" value="Người dùng không thể focus vào phần tử này." />

CSS

css
.ignored {
  -moz-user-focus: ignore;
}

Đặc tả

Không thuộc bất kỳ tiêu chuẩn nào.

Tương thích trình duyệt

Xem thêm