1. #1
    tfk's Avatar
    Registered
    11/08/03
    Posts
    588
    iTrader
    0
    Mentioned
    0 Post(s)

    "container" verschuift naar links DreamWeaver CS 5.5

    Hallo,

    Probleem waar ik nu al enkele uren mee bezig ben.
    Ik paste enkele dingen aan in een website die ik beheer en zonder echt te weten waarom verschoof de volledige inhoud van de site naar links.
    zie zelf:
    Studentenclub Moeder Meense
    Het ligt niet aan de php zelf, noch aan de template want de vorige versies vertonen hetzelfde mankement.
    Dus besluit ik dat het aan de css ligt. Nu heb ik deze zeker al 20 keer overlezen en zie ik geen fouten. De code staat op het einde.
    Ik liet ook al iemand anders er naar kijken die er wel wat meer van kent, en die vond het probleem ook niet. Weet iemand hoe dit zou komen?

    de code van de css (sorry voor de verouderde code, ik schreef ze zelf niet):

    @charset "utf-8";
    body {
    font: 100% Verdana, Arial, Helvetica, sans-serif;
    background: #666666;
    margin: 0; /* 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;
    height: auto;
    border-top-color: #000000;
    border-right-color: #000000;
    border-bottom-color: #000000;
    border-left-color: #000000;
    }
    .thrColAbsHdr #container {
    position: absolute; /* adding position: relative allows you to position the two sidebars relative to this container */
    width: 1060px; /* the auto margins (in conjunction with a width) center the page */
    height: auto;
    border: 1px solid #FFFFFF;
    text-align: center; /* this overrides the text-align: center on the body element. */
    margin-top: 0;
    margin-right: auto;
    margin-bottom: 0;
    margin-left: auto;
    background-color: #800000;
    white-space: normal;
    }

    /* Tips for absolutely positioned sidebars with header and footer:
    1. Absolutely positioned (AP) elements must be given a top and side value, either right or left. (As a default, if no top value is given, the AP element will begin directly after the last element in the source order of the page. This means, if the sidebars are first element in the #container in the document's source order, they will appear at the top of the #container even without being given a top value. However, if they are moved later in the source order for any reason, they'll need a top value to appear where you desire.
    2. Absolutely positioned (AP) elements are taken out of the flow of the document. This means the elements around them don't know they exist and don't account for them when taking up their proper space on the page. Thus, an AP div should only be used as a side column if you are sure the middle #mainContent div will always contain the most content. If either sidebar were to contain more content, that sidebar would run over the bottom of the parent div, and in this case the footer as well, and the sidebar would not appear to be contained.
    3. If the above mentioned requirements are met, absolutely positioned sidebars can be an easy way to control the source order of the document.
    4. If the source order is changed, the top value should be equal to the height of the header since this will cause the columns to visually meet the header.
    */
    .thrColAbsHdr #header {
    height: 230px; /* if you're changing the source order of the columns, you'll may want to use a height on the header so that you can give the columns a predictable top value */
    background: #FFFFFF; /* this padding matches the left alignment of the elements in the divs that appear beneath it. If an image is used in the #header instead of text, you may want to remove the padding. */
    padding-top: 0;
    padding-right: 0px;
    padding-bottom: 0;
    padding-left: 0px;
    }
    .thrColAbsHdr #header h1 {
    margin: 0; /* zeroing the margin of the last element in the #header div will avoid margin collapse - an unexplainable space between divs. If the div has a border around it, this is not necessary as that also avoids the margin collapse */
    padding: 0px; /* using padding instead of margin will allow you to keep the element away from the edges of the div */
    }
    .thrColAbsHdr #sidebar1 {
    position: absolute;
    top: 251px;
    left: 4px;
    width: 150px; /* the actual width of this div, in standards-compliant browsers, or standards mode in Internet Explorer will include the padding and border in addition to the width */
    background: #990000; /* padding keeps the content of the div away from the edges */
    padding-top: 15px;
    padding-right: 20px;
    padding-bottom: 15px;
    padding-left: 10px;
    background-color: #800000;
    }
    .thrColAbsHdr #sidebar2 {
    position: absolute;
    top: 233px;
    right: 18px;
    width: 130px; /* padding keeps the content of the div away from the edges */
    background-color: #800000;
    padding-top: 15px;
    padding-right: 10px;
    padding-bottom: 15px;
    padding-left: 20px;
    }
    .thrColAbsHdr #mainContent {
    margin-top: 0;
    margin-right: 200px;
    margin-bottom: 0;
    margin-left: 200px;
    padding-top: 0;
    padding-right: 10px;
    padding-bottom: 0;
    padding-left: 10px;
    background-color: #FFFFFF;
    }
    .thrColAbsHdr #footer {
    padding: 0;
    background-color: #800000;
    }
    .thrColAbsHdr #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 */
    }
    .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: right;
    margin-left: 8px;
    }
    .fltlft { /* this class can be used to float an element left in your page */
    float: left;
    margin-right: 8px;
    }
    .EBR_
    no votes  

  2. #2
    Huxley's Avatar
    Registered
    21/01/10
    Location
    Gent
    Posts
    3,535
    iTrader
    0
    Mentioned
    0 Post(s)
    Uw linkt sta er niet. Sowieso zal het nie aan PHP liggen e. Kveronderstel dat het over deze site gaat:
    http://www.moedermeense.be/index2.php

    ----

    Voor uw container te centreren moet ge

    margin: 0 auto;
    gebruiken op uw #container maar dan moet uw position: absolute wel weg.

    ----

    Pff, tziet er maar een rommelig boelke uit, overal die absolute positioneringen.
    't Is beter om uw 2 sidebars en uw #maincontent in een parent te laten floaten.
    Last edited by Huxley; 30-12-2011 at 05:28.
    no votes  

  3. #3
    tfk's Avatar
    Registered
    11/08/03
    Posts
    588
    iTrader
    0
    Mentioned
    0 Post(s)
    Ik heb beide uitgevoerd, maar niets lijkt te werken..
    Toch bedankt voor de hulp!
    Zoals ik zei, ik schreef de code niet en heb nu ook de tijd, noch de kennis om deze helemaal te herschrijven.
    Andere ideeën?
    .EBR_
    no votes  

  4. #4

    Registered
    14/08/10
    Location
    Diest
    Posts
    2,419
    iTrader
    1 (100%)
    Mentioned
    0 Post(s)
    Reputation
    8/16
    (Bij body: text-align: center; weg)
    Bij #container: position: absolute; weg.
    #sidebar1: left, top, position weg. Float: left; toevoegen.
    #sidebar2: right, top, position weg. Float: right; toevoegen.


    Zou moeten werken (hier getest op Chrome), maar als ge tijd hebt zou ik toch eens heel uw site herzien.

    EDIT: en zet in het vervolg uw post in CODE-tags aub
    no votes  

  5. #5
    Huxley's Avatar
    Registered
    21/01/10
    Location
    Gent
    Posts
    3,535
    iTrader
    0
    Mentioned
    0 Post(s)
    Quote Originally Posted by tfk View Post
    This quote is hidden because you are ignoring this member. Show
    Ik heb beide uitgevoerd, maar niets lijkt te werken..
    Toch bedankt voor de hulp!
    http://o7.no/rRnxcT

    Hier wordt hij anders toch mooi gecentreerd door position te vervangen door de margin.
    Position wordt enkel gebruikt als ge een element buiten u gridstructuur wilt positioneren.

    Quote Originally Posted by tfk View Post
    This quote is hidden because you are ignoring this member. Show
    Andere ideeën?
    Nen defigen template zoeken.
    Last edited by Huxley; 30-12-2011 at 16:12.
    no votes  

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Log in

Log in