html - on click hide this (button link) pure css -
my function hide , show div pure css when click open, button still not disappear.
<a href="#show" id="open" class="btn btn-default btn-sm">open</a> <div id="show"> text... <a href="#hide" id="close" class="btn btn-default btn-sm">close</a> </div> and css like:
<style> #show {display: none; } #show:target { display: inline-block; } #hide:target ~ #show { display: none; } <style> when add :
#show:target ~ #open { display: none; } the button #open still not hiding can me.
thanks before :)
you solve putting open link inside #show div
html
<div id="show"> <a href="#show" id="open" class="btn btn-default btn-sm">open</a> <div id="content"> text... <a href="#hide" id="close" class="btn btn-default btn-sm">close</a> </div> </div> css
#content { display: none; } #show:target #content { display: inline-block; } #show:target #open { display: none; }
Comments
Post a Comment