CSS Centre The Content


/ Published in: CSS
Save to your folder(s)

Code between the /**********CSS************/ comments goes in a style sheet.
Code between the /******InsertInBody*******/ comments is inserted between the



Copy this code and paste it in your HTML
  1. /**********CSS************/
  2. body {
  3. background-color:#000000;
  4. margin: 0px;
  5. padding: 10px;
  6. }
  7. #container {
  8. margin: 0 auto; /* align for good browsers */
  9. text-align: left; /* counter the body center */
  10. width: 800px;
  11. /*height:auto;*/
  12. }
  13. #mainMenu {
  14. position:relative;
  15. background-color:#CCCCCC;
  16. width:800px;
  17. height:600px;
  18. top:auto;
  19. left:auto;
  20. height:100px;
  21. }
  22. #redbox {
  23. position:absolute;
  24. width:320px;
  25. height:240px;
  26. background-color:#FF0000;
  27. }
  28.  
  29. /**********CSS************/
  30.  
  31.  
  32.  
  33.  
  34. /******InsertInBody*******/
  35.  
  36. <div id="container">
  37. <div id="mainMenu">
  38. <div id="redbox">
  39. </div>
  40. </div>
  41. </div>
  42.  
  43.  
  44. /******InsertInBody*******/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.