Show 'div' only to Internet Explorer users

Hi all,

Wondering if anyone could help with some code to show a div only to internet explorer (including ie 11) users?

I just want to display a message that says 'For the best experience please open using Chrome, Firefox or Safari.

Thanks!
Steve

Hello @speldie23

Maybe this can help:

https://browser-update.org

1 Like

This should work on all versions of internet explorer

<!--[if IE]>
    <div class="warning"><p>For the best experience please open using Chrome, Firefox or Safari</p></div>
<![endif]-->
1 Like

Hi folks,

@Sam_G sorry for the maybe obvious question, but where do I need to put the code you suggested in order for it to work?

@aaronocampo I tried browser-update.org, but I can’t find an option to tell any IE11 user to not use it and switch. It only seems to bring a message if the browser is not current, but I’d love to show the message to all outdated AND IE11 users.

Any idea how this could be accomplished?

Thanks so much for the help and happy sunday!
Cheers
BJ

I don’t think you can use this for that specific purpose, in that case I think you will have to use custom code. There are other topics about this in the forum.