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>&nbsp;&nbsp;<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;   } 

jsfiddle here


Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

order - Notification for user in user account opencart -