We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10238
    • 4 Posts
    I’ve been playing with the ThrashBox technique for rounded corners (http://www.modxcms.com/simple-rounded-corner-css-boxes.html), as I try to modify the CSS to shrink/expand the box, and change some of the paddings / margins things get all messed up (sometimes in IE, sometimes FF, sometimes both).

    I was wondering if anyone had used this technique and could explain how all the values relate.

    Thanks.
      • 20413
      • 2,877 Posts
        @hawproductions | http://mrhaw.com/

        Infograph: MODX Advanced Install in 7 steps:
        http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

        Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
        http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
        • 10238
        • 4 Posts
        Luckily I was able to get Google to translate it, but this just seems to discuss CSS in general. I’m looking for some more specifics on working with the ThrashBox technique.

        Thanks though.
          • 20413
          • 2,877 Posts
          Yeah the trashbox is much nicer!  smiley

          //did you walk down to anchor for "my" method?
            @hawproductions | http://mrhaw.com/

            Infograph: MODX Advanced Install in 7 steps:
            http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

            Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
            http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
            • 25663 MODX Staff
            • 12,272 Posts
            I suppose I should chime in here... wink

            A link would be nice with working/not working code. It’s all about getting the margins/paddings/widths right.
              Ryan Thrash, MODX Co-Founder
              Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
              • 10238
              • 4 Posts
              Here is a link to my current issue (basically the body width seems different in IE than in FF).

              http://gunygoogoo.googlepages.com/thrash.html

              I’ve done a lot of trial and error with the padding/margins before this so some of the #’s may be wrong themselves.

              I’m much more interested in understanding the math behind the #’s so I can fix these issues rather than solving this specific issue, but will be thankful for any assistance.

              Thanks in advance.
                • 10238
                • 4 Posts
                FYI - I fixed this issue by going back to your sample CSS and restarting changes. The issue seems to start when I try to get the width of the box to appear the same width in IE and FF. Right now I have:

                .cssbox { 
                    width: 255px !important; /* intended total box width - padding-right(next) */
                    width: 240px; /* IE Win = width - padding */
                    padding-right: 15px; /* the gap on the right edge of the image (not content padding) */
                    margin: 20px auto; /* use to position the box */ 
                } 


                This works fine, everything lines up, etc, however in IE the box is much narrower than FF. In all honesty I think I can figure it out from here, but I think it would be great if the CSS was explained in more detail to explain what #’s are meant to be edited, which values must stay in sync, and which come from the image itself.

                Thanks again for the great technique.
                  • 3749
                  • 24,544 Posts
                  Quote from: fsa3 at Nov 12, 2008, 09:04 AM

                  FYI - I fixed this issue by going back to your sample CSS and restarting changes. The issue seems to start when I try to get the width of the box to appear the same width in IE and FF. Right now I have:

                  .cssbox { 
                      width: 255px !important; /* intended total box width - padding-right(next) */
                      width: 240px; /* IE Win = width - padding */
                      padding-right: 15px; /* the gap on the right edge of the image (not content padding) */
                      margin: 20px auto; /* use to position the box */ 
                  } 


                  This works fine, everything lines up, etc, however in IE the box is much narrower than FF. In all honesty I think I can figure it out from here, but I think it would be great if the CSS was explained in more detail to explain what #’s are meant to be edited, which values must stay in sync, and which come from the image itself.

                  Thanks again for the great technique.

                  I found this at http://blogs.msdn.com/petel/archive/2006/05/18/601147.aspx


                  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

                  The interesting thing about including this DOCTYPE in your page, is that it causes IE to render in a more standard, and acceptable way. When it’s not there, IE renders in what is called "quirks" mode. For example, without it, IE counts the width of the DIV as the content, plus the padding and border width! So suddenly, your 500px DIV is no longer 500px, but 500px minus the width of your border (for each side) and minus the width of your padding."

                  It kind of sounds like your issue.

                  It that’s not it, you can always have specific CSS code for IE using conditional comments (and you’ll probably need to for IE6 anyway). You could load a separate .CSS file that just redefined .cssbox. The following loads the file only if the user has IE6 or below :

                  <!--[lte ie 6]>
                  <link href="css/ie6.css" rel="stylesheet" type="text/css" />
                  <![endif]-->


                  You can load different files for different versions of IE, if necessary (http://msdn.microsoft.com/en-us/library/ms537512.aspx), although I generally prefer to use this method: http://www.positioniseverything.net/articles/cc-plus.html
                    Did I help you? Buy me a beer
                    Get my Book: MODX:The Official Guide
                    MODX info for everyone: http://bobsguides.com/modx.html
                    My MODX Extras
                    Bob's Guides is now hosted at A2 MODX Hosting