Mobile app version of vmapp.org
Login or Join
Angela700

: "if … or" conditional comments? I'm working on a website for my dad, and it works nice in modern browsers, but apparently he's getting comments on how the top navigation doesn't work on Internet

@Angela700

Posted in: #BrowserDetecting #ConditionalComments #InternetExplorer

I'm working on a website for my dad, and it works nice in modern browsers, but apparently he's getting comments on how the top navigation doesn't work on Internet Explorer (7 and lower, I think). It shifts to the right instead of centering in the middle.

How do I fix this? Or, is there some sort of if/or conditional comment thing I can do that says:

IF IE... use this class for the div / OR (any other browser) use this other class

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Angela700

1 Comments

Sorted by latest first Latest Oldest Best

 

@Sarah324

You can use conditional comments to target specific versions of Internet Explorer. In your case you would want to target IE7 and lower so you would use:

<!--[if lt IE 7 ]>
<style type="text/css">
<!-- Your special rule to fix the CSS issue goes here -->
</style>
<![endif]-->

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme