Arrgghhhhhh... Any CSS "experts" around?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Tempest
    Too lazy to set a custom title
    • May 2004
    • 10217

    #1

    Arrgghhhhhh... Any CSS "experts" around?

    I need all 3 "boxes" to be the same height and it can't be fixed as the content can vary. The "container" doesn't even have a fucking height.

    Code:
    <div style="width:750px;border:1px solid black;">
    <div style="width:520px;float:left;text-align:left;padding:5px;border-right:1px solid black;">
    content
    </div><div style="width:200px;float:right;text-align:center;">
    content
    </div>
    </div>
  • Young
    Bland for life
    • Nov 2004
    • 10468

    #2
    How can they all be the same height but not be fixed at the same time? Not much support for min-height out there.

    Maybe I'm just not understanding what you're trying to do. Is this a 3 column layout?
    Last edited by Young; 07-30-2007, 08:15 PM.
    ★★★

    Comment

    • Tempest
      Too lazy to set a custom title
      • May 2004
      • 10217

      #3
      Originally posted by Young
      How can they all be the same height but not be fixed at the same time? Not much support for min-height out there.

      Maybe I'm just not understanding what you're trying to do. Is this a 3 column layout?
      2 column... IF I set the container height to a fixed value, then I can set the 2 column heights to 100% and it works (except some browsers slow way down). The problems appears to be that the container doesn't auto set it's height based on the content columns.

      Comment

      • Young
        Bland for life
        • Nov 2004
        • 10468

        #4
        So a header and 2 columns?
        ★★★

        Comment

        • Tempest
          Too lazy to set a custom title
          • May 2004
          • 10217

          #5
          Originally posted by Young
          So a header and 2 columns?
          Dude.. I posted the exact code.. a container div to set the width and 2 floating divs inside of it.

          eg:
          Code:
          <div class="container">
          <div class="content"> <!-- content column floats left -->
          </div>
          <div class="nav"> <!-- navigation column floats right -->
          </div>
          </div> <!-- end of container -->

          Comment

          • Young
            Bland for life
            • Nov 2004
            • 10468

            #6
            Code:
            #wrapper {
                 width: 750px;
            }
            
            #left {
               width: 500px;
               float: left;
            }
            
            #right {
               width: 250px;
               float: left;
            }
            Code:
            <div id = "wrapper">
            
            <div id = "left">
            
            </div>
            
            <div id = "right">
            
            </div>
            
            </div>
            I'm tired and there are a zillion different ways to do this.

            I could be way off. Thats a simple two column layout. Again. I'd need to see an example to know what you're talking about.

            my apologies
            ★★★

            Comment

            • TheDoc
              Too lazy to set a custom title
              • Jul 2001
              • 13827

              #7
              The nav needs position: absolute;

              Make sure you add at least <br style="clear:both;" /> or another div after the two columns.
              ~TheDoc - ICQ7765825
              It's all disambiguation

              Comment

              • Young
                Bland for life
                • Nov 2004
                • 10468

                #8
                Code:
                body {
                	min-height: 100&#37;;
                	}
                #wrapper {
                         width: 750px;
                	 margin-left: 200px;
                	 min-height: 100%;
                	 overflow:hidden;
                }
                fixed.

                the wrapper should now auto adjust its height depending on the content in left and right.

                again. a little tired.
                ★★★

                Comment

                • TheDoc
                  Too lazy to set a custom title
                  • Jul 2001
                  • 13827

                  #9
                  My notes say absolute, but my blog us using relative.. So the absolute is to place a div, so use relative with the float tag.
                  ~TheDoc - ICQ7765825
                  It's all disambiguation

                  Comment

                  • Young
                    Bland for life
                    • Nov 2004
                    • 10468

                    #10
                    Shit. Ignore the shit I added to the wrapper

                    Here goes the full code for a 2 Column Layout with an auto-adjusting wrapper/container.

                    Code:
                    <style type="text/css">
                    body {
                    	min-height: 100&#37;;
                    	}
                    #wrapper {
                         width: 750px;
                         margin-left: 200px;
                         background-color:#000099;
                         min-height: 100%;
                         overflow:hidden;
                    }
                    
                    #left {
                       width: 500px;
                       float: left;
                    }
                    
                    #right {
                       width: 250px;
                       float: left;
                    }
                    </style>
                    
                    
                    <body>
                    <div id = "wrapper">
                    
                    <div id = "left">
                    left
                    </div>
                    
                    <div id = "right">
                    right
                    </div>
                    
                    </div>
                    created in notepad. tested in firefox
                    Last edited by Young; 07-30-2007, 09:02 PM.
                    ★★★

                    Comment

                    • Tempest
                      Too lazy to set a custom title
                      • May 2004
                      • 10217

                      #11
                      ok cool... it appears that just using the overflowdden made the wrapper take the full height..

                      But.. and I've tried all sorts of things to set the "height", the navigation div still won't fill the entire height of the wrapper (which gets pushed by the content column).

                      Comment

                      • Tempest
                        Too lazy to set a custom title
                        • May 2004
                        • 10217

                        #12
                        The reason I need the nav column to be the full height is because it's a different background color.

                        Comment

                        • Young
                          Bland for life
                          • Nov 2004
                          • 10468

                          #13
                          Originally posted by Tempest
                          The reason I need the nav column to be the full height is because it's a different background color.
                          just create a tiny background (750px across 3px high) for your wrapper that repeats itself vertically. Include the content and nav colors in this background.

                          thats the easiest solution.
                          ★★★

                          Comment

                          • Tempest
                            Too lazy to set a custom title
                            • May 2004
                            • 10217

                            #14
                            Originally posted by Young
                            just create a tiny background (750px across 3px high) for your wrapper that repeats itself vertically. Include the content and nav colors in this background.

                            thats the easiest solution.
                            Yep.. I realized after I posted I could switch things around and set some backgrounds to get the effect I want.. Thanks.

                            Comment

                            • Young
                              Bland for life
                              • Nov 2004
                              • 10468

                              #15
                              Originally posted by Tempest
                              Yep.. I realized after I posted I could switch things around and set some backgrounds to get the effect I want.. Thanks.
                              No problem. It's not the prettiest solution as far as structure...but it works.

                              If you want to get to the bottom of this problem for future layouts check out this page.

                              http://www.pmob.co.uk/temp/2colcentred_contentfirst.htm

                              I hate using hacks because I still don't have a complete grasp of them. Even just now when I was digging through my completed layouts to find a solution for you I found myself lost in my own code.

                              Good luck
                              ★★★

                              Comment

                              • TheDoc
                                Too lazy to set a custom title
                                • Jul 2001
                                • 13827

                                #16
                                No easy solution for this, that's for sure. You can use javascript to do it too, but it doesn't work if js is off of course.
                                ~TheDoc - ICQ7765825
                                It's all disambiguation

                                Comment

                                • Tempest
                                  Too lazy to set a custom title
                                  • May 2004
                                  • 10217

                                  #17
                                  Well it's lookin all purty now... as long as the content box is higher than the nav box.. LOL... Good enough for now... Thanks guys..

                                  Comment

                                  Working...