Problem mit "wrap" in CSS

  • Problem mit "wrap" in CSS

    HAllo, ich habe ein [coderwiki]Informationen/CSS[/coderwiki] verfasst. Ich habe nur ein Problem: wie kann ich das ganze zentrieren? :?:
    Mein CSS sieht so aus:

    Quellcode

    1. @media screen{
    2. body {
    3. font-family: arial;
    4. width: 760px;
    5. text-align: left;
    6. }
    7. #wrap{
    8. width: 760px;
    9. height: 100%;
    10. margin: 0 auto;
    11. padding: 0;
    12. text-align: left;
    13. }
    14. #header{
    15. float: left;
    16. width: 760px;
    17. height: 146px;
    18. text-align: right;
    19. border-top: 1px solid #999;
    20. }
    21. #navigation{
    22. float: left;
    23. width: 760px;
    24. height: 40px;
    25. padding-top: 10px;
    26. border-bottom: 1px solid #999;
    27. border-top: 1px solid #999;
    28. background-color: rgb(166, 213, 26);
    29. }
    30. #content{
    31. float: left;
    32. height: 400px;
    33. width: 559px;
    34. }
    35. #sidebar{
    36. float: left;
    37. height: 400px;
    38. width: 201px;
    39. top: o;
    40. background-color: rgb(200, 200, 200); /*192*/
    41. }
    42. h1,h2,h3,h4,h5,p{
    43. margin: 20px;
    44. }
    45. p{
    46. margin: 15px 20px;
    47. }
    48. p.boxtext{
    49. border: 1px solid #000;
    50. padding: 5px;
    51. }
    52. blockquote{
    53. font-style: oblique; /*kursiv*/
    54. }
    55. q {
    56. font-style: oblique;
    57. }
    58. a:active{
    59. font-family: arial;
    60. color: white;
    61. font-size: 120%;
    62. text-decoration: none;
    63. }
    64. a:link{
    65. font-family: arial;
    66. color: white;
    67. text-decoration: none;
    68. }
    69. a:hover{
    70. font-family: arial;
    71. color: blue;
    72. text-decoration: none;
    73. }
    74. a:visited{
    75. font-family: arial;
    76. color: white;
    77. text-decoration: none;
    78. }
    79. }
    80. ol ol{
    81. list-style-type: decimal;
    82. }
    83. }
    Alles anzeigen


    Es wäre sehr nett, wenn mir jemand helfen könnte. Danke schon im Voraus...
  • um ein blockelement mit css zu zentrieren, bedarf es folgender anweisung:

    Quellcode

    1. margin-left:auto; margin-right:auto;


    Das bedeutet, dass sowohl der Abstand nach rechts als auch nach links automatisch festgelegt wird, je nachdem, wieviel zur Verfügung stellt. Das ergebnis ist dann dasselbe wie beim HTML-Attribut align="center" (deprecated).