We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21112
    • 156 Posts
    Hi all! I’m new to ModX (Etomite refugee) and I’m loving what I see so far. I’m especially enamoured of Dropmenu and it’s changing the way I work, especially regarding CSS use. I’ve long used CSS, but only in a superficial way. With ModX and Dropmenu, I’m starting to take it seriously, but there is much I have yet to learn. Cross-browser compatibility in particular.

    Right now I’m having some problems with the CSS on the site I’m building for a client in MSIE. The address is: http://www.orionvisuals.com/wip/furlan/

    Everything seems to be as I want it in Firefox, but MSIE is a different story:

    1: All of ther text in the site (which is laid out with CSS) appears about 30 pixels higher up the page than in firefox.
    2: I’m using :hover for my flyout submenus, and the Whatever:hover .htc trick (http://www.xs4all.nl/~peterned/csshover.html) to get it to work in msie, however that has revealed some other problems:
    a: The flyouts appear behind the body text. It seems that the z-index value of the submenu div is being ignored.
    b: Moving the mouse from the top level link to the submenu divs often breaks the hover causing the submenus to disappear
    c: The flyouts seem to be positioned 30px or so higher again than the menu items.

    Here is the template I’m using:
    (please excuse the sloppy CSS - as I said I’m learning smiley )

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Furlan Club :: Home</title>
    </head>
    
    <style>
    
    body {
    behavior:url("csshover.htc");
    background-color:#ad2c21;
    padding:0;
    margin:0;
    }
    
    p,td, li {
    font-family: arial;
    font-size:12px;
    }
    
    h1 {
    position:absolute;
    top:10px;
    right:10px;
    color:#FFFFFF;
    font-size:26px;
    font-weight:bold;
    font-family:Arial, Helvetica, sans-serif;
    margin-right:10px;
    }
    
    h2 {
    font-family:arial;
    font-size:18px;
    text-align:center;
    }
    
    h3 {
    font-family:arial;
    font-size:14px;
    text-align:center;
    padding-top:10px;
    }
    
    .menu {
    width:150px;
    position:relative;
    top:-40px;
    float:left;
    margin-top:0px;
    padding-top:0px;
    }
    
    #menu ul {
    margin-left:0px;
    padding-left:0px;
    text-align:right;
    }
    
    li ul {display: none;}
    li:hover ul {display: block;}
    
    #menu li {
    font-family:arial;
    font-size:14px;
    font-weight:bold;
    line-height:200%;
    list-style:none;
    color:#002E91;
    margin-left:0px;
    padding-left:0px;
    padding-right:15px;
    text-decoration:none;
    }
    
    #menu li a {
    color:#ffffff;
    text-decoration:none;
    }
    
    #menu li a:hover {
    color:#ffffff;
    text-decoration:underline;
    }
    
    #menu li ul {
    width:180px;
    position:absolute;
    left:150px;
    margin-top:-28px;
    padding-left:15px;
    font-size:10px;
    background-color:#002D8F;
    background-image:url(images/menubg.gif);
    z-index:9;
    }
    
    #menu li li {
    color:#E4892E;
    text-align:left;
    }
    
    .container {
    width:750px;
    margin-left:auto;
    margin-right:auto;
    margin-top:0px;
    margin-bottom:0px;
    background-image:url(images/background.gif);
    background-repeat:repeat-y;
    height:auto;
    }
    
    .header {
    width:750px;
    margin-left:auto;
    margin-right:auto;
    margin-top:0px;
    margin-bottom:0px;
    padding:0px;
    position:relative;
    }
    
    .content {
    width:auto;
    position:relative;
    top:-70px;
    margin-left:150px;
    padding-left:15px;
    padding-right:20px;
    }
    
    .footer {
    width:750px;
    margin-left:auto;
    margin-right:auto;
    }
    
    </style>
    
    <body>
    
    <div class="container">
    
    <div class="header">
    <h1>[*longtitle*]</h1>
    
    <img src="images/header.gif" alt="Furlan Club" width="750" height="147" style="margin:0px; padding:0px; display:block;" />
    
    </div>
    
    <div style="width:750px;">
    
    <div id="menu" class="menu">
    [[DropMenu]]
    </div>
    
    <div class="content">
    [*content*]
    </div>
    
    </div>
    
    
    <div class="footer">
    <img src="images/footer.gif" alt="Footer" width="750" height="58" style="display:block;" />
    </div>
    
    </div>
    
    </body>
    </html>



    Once I have the template finalised, I intend to move the style code out into a .css file, but it helps to have it inline while I’m building.

    Any help would be greatly appreciated!

    Thanks,
    Neil
      • 25663 MODX Staff
      • 12,272 Posts
      1) Always start by validating your XHTML.

      2) Always follow that with validating your CSS.

      3) You’ll find answers to most, if not all, IE-related problems at http://positioniseverything.net/
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 9878
        • 31 Posts
        hi rtrash,

        had similar problems yesterday
        my menu looked a lot different in ie and ff, but solved that by creating a seperate css for IE

        when you call your css, do it the following way:
        <link href="all.css" rel="stylesheet" type="text/css">
        <!--[if gte IE 5.5000]>
        <link href="ie.css" rel="stylesheet" type="text/css" />
        <![endif]-->


        ff will only read the first file, but IE will read the first file and then replace the tags with the one from the ie.css

        hope that helps a bit,
        steffen
          www.steffen-uhlmann.de
          • 25663 MODX Staff
          • 12,272 Posts
          It’s probably a lot safer to use <!--if lt IE 7--> since IE7 actually gets quite a few things right and is starting to surface in weblogs. It’s a laudable effort from Redmond (finally!).
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 15826
            • 160 Posts
            It’s being recommended to use lte IE 6 in the conditional comment, I think because of internal versioning of some of the IE7 beta versions.
              "I’d love to change the world but I can’t find the source code . . ."

              Custom ModX Templates
              • 2315
              • 8 Posts
              I try this
              <link href="all.css" rel="stylesheet" type="text/css">
              <!--[if IE 5]>
              <link href="ie.css" rel="stylesheet" type="text/css" />
              <![endif]-->


              And i this to make change directly in css because i juste want this line in FF style
              float:left !important;
              this hack do work on Modx ?

              For What ?

              thanks

                • 25663 MODX Staff
                • 12,272 Posts
                MODx puts no restrictions on any CSS or XHTML. What you put in is what you get out.
                  Ryan Thrash, MODX Co-Founder
                  Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me