The label label defines the callout for the INPUT element.
The label element does not render any special effects. But he has improved usability for mouse users. This control is triggered if you tap text inside a LABEL element. This means that when the user chooses the tag, the browser automatically shifts the focus to the controls that are related to the form.
It has two properties for the from.
The for rule binds to which form element. (The For property value of the label element must be the same as the id attribute value of the related form element)
One or more forms to which the From Rule field belongs.
Example: Common Web side bar pop-up effect can also be fully implemented with CSS animation. The label tag is now applied.
<!DOCTYPE HTML><HTMLLang= "en"><Head> <MetaCharSet= "UTF-8"> <title>Document</title> <style> *{margin:0;padding:0; }P{padding:10px 0; }Body{Min-height:100%; }input{Display:None; }aside{position:Absolute; Left:-200px;Top:0;Bottom:0;width:200px;Background-color:#BB6868;
transition:0.25s ease-out; -webkit-transition:0.25s ease-out; }#sidebutton: Checked + aside{ Left:0; }#sidebutton: Checked ~ #wrap{Padding-left:220px; }#wrap{Margin-left:20px;padding:10px;
transition:0.25s ease-out; -webkit-transition:0.25s ease-out; }#wrap >label{Border:None;Background-color:Green;Color: White; }#wrap >label:hover{background:#000; } </style></Head><Body> <inputtype= "checkbox"ID= "Sidebutton"> <aside>Navigation bar</aside> <DivID= "Wrap"> <label for= "Sidebutton">Menu</label> <P>HTML and CSS for sidebar popup effects</P> </Div></Body></HTML>
This example shows the application of label labels very well. With the combination of label and input in the application of CSS animation can be very good to solve some simple click animation above the page. (PowerPoint effect slides can also be implemented with this)
A little understanding of the HTML label label