On click hide button link with pure css - HTML CSS HTML Tag

HTML CSS examples for HTML Tag:a

Description

On click hide button link with pure css

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">

:checked ~ .btn-default, #show, .checkbox {
   display: none;
}
:checked ~ #show {<!--   w  ww . j  ava  2s. c  om-->
   display: block;
}
.show-text:after {
   content:"Open";
}
:checked + .show-text:after {
   content:"";
}
.second-label, .show-text {
   text-decoration: underline;
   cursor: pointer;
}


      </style> 
 </head> 
 <body> 
  <input id="checkbox" type="checkbox" class="checkbox"> 
  <label id="open" for="checkbox" class="btn btn-default btn-sm"> <span class="show-text"></span> </label> 
  <div id="show">
    some text... 
   <label for="checkbox" class="second-label btn btn-default btn-sm">Close</label> 
  </div>  
 </body>
</html>

Related Tutorials