By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,566 Members | 1,785 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,566 IT Pros & Developers. It's quick & easy.

Website Help. Can't center things.

P: 1
Hello. I recently did something so my webpage's background would auto adjust to the window size but now i can't center anything. I've tried <center> and <div align="center">.

Any suggestions?

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <title>CSSelect</title>
  4. <link rel="stylesheet" type="text/css" href="scselect.css">
  5.  
  6. <style type="text/css">
  7. body {margin:0px;}
  8. #bg_image {
  9. width: 100%;
  10. height: 100%;
  11. left: 0px;
  12. top: 0px;
  13. position: absolute;
  14. z-index: 0;
  15. }
  16. #contents {
  17. z-index: 1;
  18. position: absolute;
  19. }
  20. </style>
  21. </head>
  22.  
  23. <body>
  24.  
  25. <div id="bg_image">
  26. <img src="http://bytes.com/images/background.jpg" style="width 100%; height: 100%;">
  27. </div>
  28.  
  29.  
  30. <div id="contents">
  31.  
  32. <center>
  33. <img src="http://bytes.com/images/banner.png">
  34. </center>
  35.  
  36.  
  37. <div id="navigation">
  38. |
  39. <a href="index.html">Home</a>     |
  40. <a href="register.html">Register</a>     |
  41. </div>
  42.  
  43. </div>
  44. </body>
  45. </html>
Feb 3 '12 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.