A detailed example of using the focus pseudo-class in CSS

Source: Internet
Author: User
CSS in the use of the focus pseudo-class examples of detailed;

CSS: The use of the focus pseudo-class, that is, to set the style for the element that has the focus

Example One

<! DOCTYPE html>

Above through: The Focus gives input box the style setting when the focal point is given

Example Two

: When focus is used in the navigation bar of a page, the code example is as follows:

<! DOCTYPE html>


When the element is taken to the focus, if the element is a valid link, then the link address can be entered by the "Enter" key;

The TAB key can also be used to traverse all the focusable elements to get the focus;

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.