1.

Explain the difference between z-index and tabindex.

Answer»

z-index is a CSS property that allows the creation of a custom stacking order of elements. The z-index property can be provided with an integer value representing the position of that element ALONG the z-axis. This value can be either negative, positive, or zero.  

On the other hand, the tabindex is an HTML attribute indicating whether the element can be focused by sequential KEYBOARD navigation, usually done with the Tab key, and in what order. Similar to z-index, the tabindex attribute also takes an integer value, either negative, positive, or zero. A negative value indicates that the element cannot be sequentially navigated USING the keyboard, but can be focused on using JAVASCRIPT or by clicking with the mouse. A positive value indicates that the element can be focused sequentially via the keyboard navigation, with its order defined by the numerical value provided. An element with the tabindex value 0 can be focused on using the keyboard after any element with a positive tabindex value.



Discussion

No Comment Found