Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to open and close div using css

    • 0
    • 1
    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 4.50k
    Comment on it

    Hello! readers,
    There is an example to show a div on click using only css. You can use it as popup box also.

    --css--

     .show , .hide{color:#FC6}
      #contain {display: none; border:1px solid #999;padding:10px;width:200px;margin-top:10px}
      .show:focus + .hide {display: inline; }
      .show:focus + .hide + #cont {display: block;}
    

    --html--

       <div>
            <a href="#show" class="show">Show</a>
            <a href="#hide" class="hide">Hide</a>
            <div id="contain">
                This is hidden text
            </div>
       </div>
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: