Guest User

Untitled

a guest
Jan 23rd, 2016
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <style>
  5. * {
  6. padding: 0;
  7. margin: 0;
  8. }
  9. .fit { /* set relative picture size */
  10. max-width: 100%;
  11. max-height: 100%;
  12. }
  13. .center {
  14. display: block;
  15. margin: auto;
  16. }
  17. </style>
  18. </head>
  19. <body>
  20.  
  21. <img class="center fit" src="pic.jpg" >
  22.  
  23. <script src="http://code.jquery.com/jquery-latest.js"></script>
  24. <script type="text/javascript" language="JavaScript">
  25. function set_body_height() { // set body height = window height
  26. $('body').height($(window).height());
  27. }
  28. $(document).ready(function() {
  29. $(window).bind('resize', set_body_height);
  30. set_body_height();
  31. });
  32. </script>
  33.  
  34. </body>
  35. </html>
Add Comment
Please, Sign In to add comment