locked
Conditional comments...bug or feature I don't understand? RRS feed

  • Question

  • Hey Gang,

    I have a page which using a fluid layout and looks just how I want it in FF and GC, so to make it identical in IE (7) I added a conditional comment block to house a minor layout abstraction.

    <!--[IF IE]>
    <style type='text/css>
     #customPageContent .textInput { border: 1px solid #4A718C; height: 24px }
    </style>
    <![endif]-->

    In my other version I have a width which IE doesn't like as the text inputs are initially empty...but thats not the issue.

    The issue here is that in EW2 when I hit "save", the application turns the above into:

    <!--[IF IE]>
    <![endif]-->
    <style type='text/css>
     #customPageContent .textInput { border: 1px solid #4A718C; height: 24px }
    </style>
    <![endif]-->

    It has automatically added an "endif" block even though I already had one.

    So if I then delete the end one and move my code into the new block and hit "save" again...once again EW2 adds an "endif" block.


    Is this is bug here? Is there a setting I missed to turn off auto-fixing (even though it isn't broken! ) ?

    Also...what is the pane that is used for design, as what appears in there is not how any of the versions of IE render the page? I know its not supposed to be a wysiwyg but I have always been confused why EW uses a design view that matches its content when the browser by the same comapny does not.

    All hail the day of the release of IE8.

    Thanks,
    Paul
    Life Is...
    Monday, November 10, 2008 5:07 AM

Answers

  • I've tried your exact code and it doesn't add the extra <![endif--> for me. I do note that EW puts it all in grey, like a comment, unless you use lowercase for the opening tag. eg <!--if IE> rather than <!--IF IE>. However I've tried both variants and they both work.

    One thought, this is all within the <head>..</head> tags isn't it?

    The EW design surface is working to strict standards, more so than IE7, which is why you may see some differences. IMO this is the correct thing to do, rather than match the bugs in versions of IE.

    Ian

    http://www.ew-resource.co.uk
    http://www.fp-resource.co.uk


    Ian Haynes
    Monday, November 10, 2008 8:54 AM

All replies

  • I've tried your exact code and it doesn't add the extra <![endif--> for me. I do note that EW puts it all in grey, like a comment, unless you use lowercase for the opening tag. eg <!--if IE> rather than <!--IF IE>. However I've tried both variants and they both work.

    One thought, this is all within the <head>..</head> tags isn't it?

    The EW design surface is working to strict standards, more so than IE7, which is why you may see some differences. IMO this is the correct thing to do, rather than match the bugs in versions of IE.

    Ian

    http://www.ew-resource.co.uk
    http://www.fp-resource.co.uk


    Ian Haynes
    Monday, November 10, 2008 8:54 AM
  • Please post a link to the page in question. Like Ian no extra endif is added So there must be another error.

    Also, I would like to see why you "need" a conditioned common for for IE 7 since unless there is some reason you need to force "haslayout" in IE there should be no need for the conditioned common you are using. I have never seen any problems in IE with empty text fields either. I suspect you have otter errors in the html and css.
    MS MVP Expression http://by-expression.com
    Monday, November 10, 2008 2:41 PM