Input type radio - how to use the for attribute for a span and not only for the label - HTML CSS CSS Form

HTML CSS examples for CSS Form:input radio button

Description

Input type radio - how to use the for attribute for a span and not only for the label

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> 
  <style id="compiled-css" type="text/css">
label.fa {<!--   w  ww  . j  a  va  2  s.c o  m-->
   display:block !important;
   text-align:center;
}

ul {
   list-style:none;
}

li {
   float:left;
}

.fa {
   font-size:31px;
}
</style> 
 </head> 
 <body> 
  <nav> 
   <ul> 
    <li> <label class="fa fa-address-book" for="firmenkunde"></label> <span class="notepad--display" data-txt="ShopNavigationFirmenkunde"> <input type="radio" id="firmenkunde" name="kunde" value="firmenkunde"> <label for="firmenkunde">Lorem ipsum</label> </span> </li> 
    <li> <label class="fa fa-address-book-o" for="privatkunde"></label> <span class="notepad--display" data-txt="ShopNavigationPrivatkunde"> <input type="radio" id="privatkunde" name="kunde" value="privatkunde"> <label for="privatkunde">Lorem ipsum</label> </span> </li> 
   </ul> 
  </nav>  
 </body>
</html>

Related Tutorials