We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25551 ☆ A M B ☆
    • 1,231 Posts
    I need some help with an idea i have...

    I want to have the following chunk code contained in a div tag but the chunk keeps going to the very top of my site instead of being held in the div container.


    chunk name {{content}}
    <div style="position: absolute; width: 180px; height: 100px; background-color: black; top: 15px; left: 0px">
    </div>
    <div style="position: absolute; width: 10px; height: 100%; background-color: red; top: 15px; left: 180px">
    </div>
    <div style="position: absolute; width: 578px; height: 100%; background-color: aqua; top: 15px; left: 190px">
    </div>
    


    I want this held in the template in side a div container which i used

    <div align="center">
    {{content}}  
    </div>
    


    This isn’t working... what i am trying to do is create a block for the left side with links to various pages on my site which remains static at the top left... 180px
    and a content box to the right that has a dynamic height, width 578px, for when i add more info. I added a 10px seperator.

    Could someone give me some pointers on where i am going wrong?


      Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
      AugmentBLU - MODX Partner

      BLUcart - MODX Revolution E-Commerce & Shopping Cart
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Working with absolutely positioned containers can have their own odd little quirks. Absolute positioning takes a container out of the normal flow of the HTML, and makes things behave as one might not expect at times. You might be better off with one of the multi-column float layouts. I tend to favor this one:
      http://www.positioniseverything.net/articles/onetruelayout/anyorder
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 5091
        • 332 Posts
        chinesedream Reply #3, 19 years ago
        Quote from: sottwell at Oct 29, 2007, 11:35 PM

        Absolute positioning takes a container out of the normal flow of the HTML, and makes things behave as one might not expect at times.

        That is true but there is exception. You can still make an absolute div stays in the content, anywhere you like it. The trick is to add a ’position: relative’ in the outer div like so.

        #container {position: relative; width: 50em; margin: 0 auto}

        <div id="container">
        <!-- any absolute position element will stay inside the container -->

        </div>

          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Yes, but what I was talking about is that there are some bugs (usually in IE, big surprise there) that affect the behavior of things contained within the absolute positioned container.

          http://www.brunildo.org/test/IE_raf3.html

          And some behaviors that may not be what was expected:

          http://forums.htmlhelp.com/index.php?showtopic=3901
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 25551 ☆ A M B ☆
            • 1,231 Posts
            Thank you guys, i’m running late for class so i’ll check this out when i get back! I’ll come back if i need some more help. Thank you again.
              Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
              AugmentBLU - MODX Partner

              BLUcart - MODX Revolution E-Commerce & Shopping Cart
              • 5091
              • 332 Posts
              Quote from: sottwell at Oct 30, 2007, 01:52 AM

              Yes, but what I was talking about is that there are some bugs (usually in IE, big surprise there) that affect the behavior of things contained within the absolute positioned container.

              http://www.brunildo.org/test/IE_raf3.html

              And some behaviors that may not be what was expected:

              http://forums.htmlhelp.com/index.php?showtopic=3901

              Well, that is no news and no surprising. But the point is, there are at least 10 different methods to get to the same result in CSS, which method is better and works best for IE, lies on one’s knowledge on CSS and the understanding one has on how IE behaves.

              It’s possible to make absolute elements stayed inside a relative container and still make IE 6 works well, and I found this approach creates less (if not none) trouble in IE 6

              <div id="container" style="position:relative">

              <div> some content here..</div>
              <div><!-- this div is a floated or none floated element with relative /default position -->
              <div>mxxxx</div>
              <div style="position:absolute"> an absolute positioned element here</div>
              </div>
                • 25551 ☆ A M B ☆
                • 1,231 Posts
                Here is an illustration of what i am trying to achieve.

                I have the template set with the header, footer and side borders correctly... the borders are set to 100% so the 8px images i have are stretching so the site looks seemless. I basically want to create a main div container that i can have other containers within... so i can have a block for my menu to the left... news items to the right. See the picture if you don’t understand LOL... thanks guys
                  Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
                  AugmentBLU - MODX Partner

                  BLUcart - MODX Revolution E-Commerce & Shopping Cart
                  • 5091
                  • 332 Posts
                  Hi rossco, I need to see your page before I can give you a direction wink
                    • 25551 ☆ A M B ☆
                    • 1,231 Posts
                    Sure

                    http://www.rossco-designs.com/main/main/index.php

                    It’s not got the area for where i want the block and news area yet... i can’t get it to do what i want.

                    I upped a new picture that might explain a little more what i want. above!
                      Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
                      AugmentBLU - MODX Partner

                      BLUcart - MODX Revolution E-Commerce & Shopping Cart
                      • 25551 ☆ A M B ☆
                      • 1,231 Posts
                      Ok i have activated my block and news boxes... as you can see they are on top of each other. I was the news boxes on top of each other but the menu block to the left of the top news box. undecided
                        Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
                        AugmentBLU - MODX Partner

                        BLUcart - MODX Revolution E-Commerce & Shopping Cart