SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Enthusiast meltingInPhoenix's Avatar
    Join Date
    May 2005
    Posts
    66
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Mac Hide IE Hack Problems

    I really would like to start ANSWERING questions about CSS on this forum as opposed to asking, but once again, here I am asking.

    I was using the Mac Hide IE method to fix a problem I was finding. It looked like that would solve the problem, but when I tested it on the Mac here, it didn't work. So I decided to run a little test on my own and found that I could hide certain things but not others. Below is the test:

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>A CSS TESTPAGE</title>
    <style type="text/css">
    
    body {
    	text-align: center;
    	}
    	
    #testBox {
    	position: relative;
    	margin: auto;
    	width: 718px;
    	height: 10px;
    	background-color: #ccc;
    	border: 1px dashed #333; 
    	}
    	
    /* HIDE FROM MAC IE */
    /* \*/
    #testElement {
       color: #ff6600;
       }
    #testBox {
       border: 1px solid #333;
       }
    /* END HIDE */
    </style>
    </head>
    <body>
    <div id="testElement">This font color should be orange in all browsers EXCEPT OSX/Mac IE 5.x (This has been tested and is TRUE)</div>
    <br><br>
    The box below should be have a solid border in all browsers EXCEPT OSX/Mac IE 5.x where there should be NO border (This has been tested and is FALSE)
    <div id="testBox"></div>
    </body>
    </html>
    Am I doing something wrong here?

  2. #2
    Winemaster bronze trophy BonRouge's Avatar
    Join Date
    Oct 2004
    Location
    Sendai, Japan
    Posts
    2,417
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try changing this :
    Code:
    /* HIDE FROM MAC IE */
    /* \*/
    to this :
    Code:
    /* HIDE FROM MAC IE \*/

  3. #3
    SitePoint Enthusiast meltingInPhoenix's Avatar
    Join Date
    May 2005
    Posts
    66
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    BonRouge...thanks for your help. Made the change but still doesn't test out. I'm getting a border in Mac IE5.2...and at that, a dashed border! I've flushed the cache and history as well.

  4. #4
    SitePoint Enthusiast meltingInPhoenix's Avatar
    Join Date
    May 2005
    Posts
    66
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Here's a PC IE6 vs. Mac IE5.2 screenshot

    Here's what I'm seeing
    Attached Images Attached Images

  5. #5
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,556
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    lol - If you don't want mac to have a dashed border then don't give it one
    Code:
    #testBox {
    	position: relative;
    	margin: auto;
    	width: 718px;
    	height: 10px;
    	background-color: #ccc;
    	border: 1px dashed #333; 
    	}
    Take out the mac hack part and you will see that all browsers have the dashed border.

    The mac hack hides the styles exactly as it has been documented to do so

  6. #6
    SitePoint Enthusiast meltingInPhoenix's Avatar
    Join Date
    May 2005
    Posts
    66
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Damn...I'm so tired and frustrated (and embarrassed). I guess I am confused about how the damn hack works. I just tried changing the above code to solid so it matched the above one, and it still doesn't make the border NOT appear in the Mac browser.

  7. #7
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,556
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    lol - what are you trying to do exactly?

    If you want mac not to have a border then don't give it one.
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>A CSS TESTPAGE</title> <style type="text/css"> body { text-align: center; } #testBox { position: relative; margin: auto; width: 718px; height: 10px; background-color: #ccc; border: none; /* not really needed but just to prove a point*/ }
    /* the code below will be given to every other browser except mac */ /*HIDE FROM MAC IE \*/ #testElement { color: #ff6600; } #testBox { border: 1px solid #333; } /* END HIDE */ </style> </head> <body> <div id="testElement">This font color should be orange in all browsers EXCEPT OSX/Mac IE 5.x (This has been tested and is TRUE)</div> <br><br> The box below should be have a solid border in all browsers EXCEPT OSX/Mac IE 5.x where there should be NO border (This has been tested and is FALSE) <div id="testBox"></div> </body> </html>
    The mac hack just hides anything in those nested comments from ie mac. Therefore you give ie mac the style it needs in your normal declaration and then in the mac hiding hack comments you provide alternate styles for everybody else. These styles will overwrite whatever was in the normal style (assuming there are similar styles of course).

    It's quite straight forward really.

  8. #8
    SitePoint Enthusiast meltingInPhoenix's Avatar
    Join Date
    May 2005
    Posts
    66
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Paul. I had the logic flip-flopped, thinking that because the comments said "Hide from MAC IE" that what was put below those comments were what didn't get shown in the Mac browser, as opposed to visa-versa.

  9. #9
    SitePoint Enthusiast meltingInPhoenix's Avatar
    Join Date
    May 2005
    Posts
    66
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Err...that didn't sound right either but I think you see what I'm saying.

  10. #10
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,556
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    Yeah I think I know what you meant


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •