Advertisement
Guest User

PayneLess Designs - Image Dead Center on Page Technique

a guest
Apr 28th, 2010
1,517
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.27 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <title>Image Dead Center on Page Technique</title>
  5. <meta name="description" content="" />
  6. <meta name="keywords" content="" />
  7. <meta name="author" content="Ron" />
  8. <meta name="date" content="2/23/2009" />
  9. <meta name="copyright" content="PayneLess Designs" />
  10. <!-- <link type="text/css" rel="stylesheet" href="css_page_designs.css"> -->
  11. <!-- <script type="text/javascript" src=""></script> -->
  12. <style type="text/css">
  13. * { margin: 0; padding: 0; border: 0; }
  14.  
  15. body, html {
  16. background: #fc6;
  17. font: normal 11px "Comic Sans MS",;
  18. color: #333;
  19. }
  20.  
  21. #container {
  22. position:absolute;
  23. top: 50%;
  24. left: 50%;
  25. width: 300px;
  26. height: 200px;
  27. margin: -100px 0 0 -150px;
  28. background: #ccc;
  29. }
  30.  
  31. #container p {
  32. text-align: center;
  33. height: 200px;
  34. line-height: 25px;
  35. }
  36.  
  37. img#test {
  38. width: 195px;
  39. height: 175px;
  40. }
  41. </style>
  42. </head>
  43. <body>
  44. <div id="container">
  45. <p>This is vertically &amp; horizontally centered: <img id="test" src="http://img534.imageshack.us/img534/4864/boat6087218.jpg" alt="fishing boat" /></p>
  46. </div>
  47. </body></html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement