Why is left sidebar not being contained?

Discussion in 'CSS' started by mnymkr, Jan 1, 2010.

  1. #1
    for some reason my container class will not contain my left sidebar. I cannot find a mistake in my css or if i missed a clear, can someone help , thanks! here is the link that shows the problem


    http://www.forexregistration.com/about-us
     
    mnymkr, Jan 1, 2010 IP
  2. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #2
    because it's a float, and floats are not in flow. You need to set the wrapping element (#inner I think) to wrap floats. Most people would tell you to add some asshattery like 'clearfix' to it, when that's really unnecessary. You've already got a width on it so 'haslayout' is triggered, meaning IE should already be wrapping that float... You just need to add "overflow:hidden;" to #inner to make it wrap floats in Firefox/Opera/Safari/Chrome (basically everyone except IE7/earlier)
     
    deathshadow, Jan 1, 2010 IP
  3. mnymkr

    mnymkr Well-Known Member

    Messages:
    2,328
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    120
    #3
    i usually use the clear both method but it seems to me that all floated div are cleared? where would in insert that if i chose to go that way?
     
    mnymkr, Jan 1, 2010 IP
  4. fixie

    fixie Member

    Messages:
    25
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #4
    Just wrap "sidebar-left" division and "main" division with a parent division and give it styling that deathshadow wrote.
     
    fixie, Jan 1, 2010 IP
  5. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #5
    Right before you close #inner - but that's putting stuff in the markup that has NO **** BUSINESS in the markup. That's what putting the clearing behavior on #inner is for.
     
    deathshadow, Jan 1, 2010 IP
  6. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Stomme poes, Jan 1, 2010 IP
  7. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #7
    kk5st, Jan 1, 2010 IP
  8. mnymkr

    mnymkr Well-Known Member

    Messages:
    2,328
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    120
    #8
    First of all let me say thanks

    Here is my issue....I have used and modified this same Drupal theme, 100 times over.

    I have always resolved issues with well placed clear's

    This is the first time I had even heard of or needed overflow

    I just not sure what has changed.
     
    mnymkr, Jan 1, 2010 IP
  9. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #9
    That's what I thought when I realised James Earl Jones didn't die. I was so sure he had.
     
    Stomme poes, Jan 2, 2010 IP
  10. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #10
    What has changed is that we're trying to teach you a better way of doing things.

    There's a lot of outdated outmoded poorly planned and poorly thought out methodologies in all the tutorials and books out there - this is hardly surprising in the computing industry where 3 years is obsolete, five years is the scrap heap. (and why anything more than a 2 year degree in computer science isn't worth a sheet of bog roll)

    Basically you were taught to do it the old way pre-2004 style, we're showing you how it should be done today.... and how it SHOULD have been handled after 1998! Got to love it when it took six years from CSS 2.1 FINAL to even have it deployable - and why I laugh at the people deploying CSS3 in the wild when the specification isn't even out of DRAFT.
     
    deathshadow, Jan 2, 2010 IP
  11. mnymkr

    mnymkr Well-Known Member

    Messages:
    2,328
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    120
    #11
    yes but what you aren't listening to is this.

    I didn't write the theme, someone else did, I made two slight modifactions, adding two non float divs,
    so i do not want to change the whole theme.

    so you gave me advice on how to fix it, it did not work.

    so here i am with still the same problem

    the old pre 2004 way works on all major browsers, sure IE7/8 has trouble but FF 3 is crap and slows every computer in my house down.
     
    mnymkr, Jan 2, 2010 IP
  12. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #12
    We don't blame you for using a crappy theme... we don't blame those who buy a Yugo disguised as a Mercedes either. It's not your fault, and trying to change even Good Drupal themes is not easy due to the excessive classitis and multiple, unnecessary wrappers and containers they throw on everything.

    I mean, this is pure bunk:
    
      <body class="sidebar-left">
    
    Code (markup):
    I can't imagine how anyone even comes up with the idea of an entire page being a sidebar... a sidebar to what?? What could be further to the right of the body??? Nothing.

    I'm learning Drupal myself, but with the goal of learning how to properly remove all the BS from a theme, all teh crappy HTML and the redundant CSS, and put my own in, but with the backend Drupally stuff still intact.

    So, it looks like .container really does hold everyone (main and sidebar) together, and container has the white background. In the CSS you also have the clearfix stuff in there with .container:after blah blah... so why isn't is working?
    I think it's not working because the container is closing too early. Even though in the HTML there's this line
    </div> <!-- /.container -->
    I think there's another </div> somewhere earlier and the container closes before all the content inside it is finished.

    http://validator.w3.org/check?uri=h...(detect+automatically)&doctype=Inline&group=0

    I think the errors near the bottom indicate this. Some mismatch of divs.

    I'm betting once those get sorted out, the CSS will be able to do its job (it looks ok otherwise, regarding the .container enclosing its floats).

    You'll have to do a step by step matching of <div> with </div> to find the early closer.
     
    Stomme poes, Jan 4, 2010 IP