css: use of focus pseudo-class

一个新手
Release: 2017-10-20 09:15:26
Original
2108 people have browsed it

In css: use of focus pseudo-class, that is, setting styles for elements that have received focus

Example 1


  :focus 
Copy after login

The above is passed: focus to The input input box has set the style when it gets focus

Example 2

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


  :focus 
Copy after login

Addition:

When the element gets the focus, if the element is a If there is a valid link, you can enter the link address by pressing the "Enter" key;

You can also press the "Tab" key in the page to traverse all available The element that gets focus makes it focus;

The above is the detailed content of css: use of focus pseudo-class. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!