css - How can I expand a container using :target? -
i wondering it possible use nested ":target" directive modify elements on page pure css. bringing in form text area absolutely positioned inside div element (.container). when text area appears, want 3 things:
1) open link dissapear 2) close link appear 3) contaner div expand form element
i have been trying nesting :target element inside .container not working. possible?
<div class="container" id="container"> <h4><a href="#comments" id="open">show</a> <a href="#" id="close">close</a></h4> <div id="comments"> <form name="myform"> <p>write comment:<br /> <textarea name="mytextarea"></textarea></p> </form> </div> </div>
css
.container{ position:relative; background:pink; &:target { transition: 1s ease; a#open { display: none; } a#close {display: block;} } a#close { display: none; } } #comments { position:absolute; height:200px; width:400px; background:yellow; left:-300%; top:30px; transition: 1s ease; } #comments:target { transition: 1s ease; left:20px; }
Comments
Post a Comment