Home >Web Front-end >HTML Tutorial >A little understanding of HTML label tags

A little understanding of HTML label tags

巴扎黑
巴扎黑Original
2017-06-27 11:50:111586browse

The

label label defines the label for the input element.

The label element does not render any special effects. However, it improves usability for mouse users. If you click on the text within the label element, this control will be triggered. That is to say, when the user selects this label, the browser will automatically turn the focus to the controls related to the form.

It has two attributesfor from.

for specifies which form element to bind to. (The value of the for attribute of the label element must be the same as the value of the id attribute of the related form element)

from specifies one or more forms to which the field belongs.

Example: The common web page sidebar pop-up effect can also be completely realized using cssanimation. At this point the label label is applied.


    
    Document
    
        
        
        
        
        
        
        
        
        
        
    
    
    导航栏
    
        Menu
        HTML和CSS实现侧边栏弹出效果

This example shows the application of label tag very well. Through the combination of label label and input, CSS animation in the application can solve some simple click animation effects on the web page. (Such as ppt effect slides can also be achieved with this)

The above is the detailed content of A little understanding of HTML label tags. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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