Your Ad Here

Posted By

melomano on 11/15/11


Tagged


Versions (?)

lightbox


 / Published in: CSS
 

  1. .black_overlay{
  2. display: none;
  3. position: absolute;
  4. top: 0%;
  5. left: 0%;
  6. width: 100%;
  7. height: 100%;
  8. background-color: black;
  9. z-index:1001;
  10. -moz-opacity: 0.8;
  11. opacity:.80;
  12. filter: alpha(opacity=80);
  13. }
  14.  
  15. .white_content {
  16. display: none;
  17. position: absolute;
  18. top: 25%;
  19. left: 25%;
  20. width: 50%;
  21. height: 50%;
  22. padding: 16px;
  23. border: 16px solid orange;
  24. background-color: white;
  25. z-index:1002;
  26. overflow: auto;
  27. }
  28.  
  29. <p>This is the main content. To display a lightbox click <a href = "" onclick = "document.getElementById('light').style.display='block';document.getElementById('fade').style.display='block'">here</a></p>
  30. <div id="light" class="white_content">This is the lightbox content. <a href = "" onclick = "document.getElementById('light').style.display='none';document.getElementById('fade').style.display='none'">Close</a></div>
  31. <div id="fade" class="black_overlay"></div>

Report this snippet  

You need to login to post a comment.