0 Replies Latest reply on Feb 23, 2010 3:03 PM by dubya78

    how do I center my container in browser

    dubya78

      I'm a noob...can somebody tell me why my container isn't centering in IE or LiveView....here is ze code:

       

      @charset "utf-8";
      body  {
      font: 100% Verdana, Arial, Helvetica, sans-serif;
      background: #666666;
      margin: 0 auto; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
      padding: 0;
      text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
      color: #000000;
      min-width: 1000px;
      max-width: 1000px;
      position: fixed;
      float: right;
      }

      .twoColLiqLtHdr #wrapper {   
      width:1000px; /**adjust as needed**/    
      margin:0 auto;
      }

      .twoColLiqLtHdr #container {
      width: 80%;  /* this will create a container 80% of the browser width */
      background: #FFFFFF;
      margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */
      border: 1px solid #000000;
      text-align: center; /* this overrides the text-align: center on the body element. */
      max-width: 1000px;
      min-width: 1000px;
      }
      .twoColLiqLtHdr #header {
      padding: 0;
      ;
      }

      /* Tips for sidebar1:
      1. since we are working in percentages, it's best not to use padding on the sidebar. It will be added to the width for standards compliant browsers creating an unknown actual width.
      2. Space between the side of the div and the elements within it can be created by placing a left and right margin on those elements as seen in the ".twoColLiqLtHdr #sidebar1 p" rule.
      3. Since Explorer calculates widths after the parent element is rendered, you may occasionally run into unexplained bugs with percentage-based columns. If you need more predictable results, you may choose to change to pixel sized columns.
      */
      .twoColLiqLtHdr #sidebar1 {
      float: left;
      width: 24%; /* since this element is floated, a width must be given */
      background: #EBEBEB; /* the background color will be displayed for the length of the content in the column, but no further */
      padding: 15px 0; /* top and bottom padding create visual space within this div  */
      }
      .twoColLiqLtHdr #sidebar1 h3, .twoColLiqLtHdr #sidebar1 p {
      margin-left: 10px; /* the left and right margin should be given to every element that will be placed in the side columns */
      margin-right: 10px;
      }

      /* Tips for mainContent:
      1. the space between the mainContent and sidebar1 is created with the left margin on the mainContent div.  No matter how much content the sidebar1 div contains, the column space will remain. You can remove this left margin if you want the #mainContent div's text to fill the #sidebar1 space when the content in #sidebar1 ends.
      2. to avoid float drop at a supported minimum 800 x 600 resolution, elements within the mainContent div should be 430px or smaller (this includes images).
      3. in the Internet Explorer Conditional Comment below, the zoom property is used to give the mainContent "hasLayout." This avoids several IE-specific bugs.
      */
      .twoColLiqLtHdr #mainContent {
      margin: 0 20px 0 26%; /* the right margin can be given in percentages or pixels. It creates the space down the right side of the page. */
      }
      .twoColLiqLtHdr #footer {
      padding: 0 10px; /* this padding matches the left alignment of the elements in the divs that appear above it. */
      background:#DDDDDD;
      }
      .twoColLiqLtHdr #footer p {
      margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */
      padding: 10px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */
      }

      /* Miscellaneous classes for reuse */
      .fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
      float: left;
      margin-left: 8px;
      }
      .fltlft { /* this class can be used to float an element left in your page */
      float: right;
      margin-right: 8px;
      }
      .clearfloat { /* this class should be placed on a div or break element and should be the final element before the close of a container that should fully contain a float */
      clear:both;
          height:0;
          font-size: 1px;
          line-height: 0px;
      }

       

      Thanx for looking at it....