Posted By

RubenBristian on 01/18/11


Tagged

css


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

silverskymedia
kubaitis
TraceyM


Fullsize background image


 / Published in: CSS
 

  1. /* css */
  2. #bg {
  3. position:fixed;
  4. top:-50%;
  5. left:-50%;
  6. width:200%;
  7. height:200%;
  8. }
  9. #bg img {
  10. position:absolute;
  11. top:0;
  12. left:0;
  13. right:0;
  14. bottom:0;
  15. margin:auto;
  16. min-width:50%;
  17. min-height:50%;
  18. }
  19.  
  20. /* html */
  21. <div id="bg">
  22. <img src="images/background.jpg" alt="Background Image" />
  23. </div>

Report this snippet  

You need to login to post a comment.