0

I am creating a website based from tumblr that seems to work fine on google chrome, but has a issue with the ad box that I have assigned to the right of the page. I have searched google and found this related question, but the answer given does not work for me.

I have tried the following.
Just adding a html class="ie9" tag with the proper if statements.

Clearing my cache.
And checking the browser mode.

It seems to be just one element of the page. The right side does not show up correctly, but I fiddled with the customization in IE 9 and I have the exact margin reqs. However I can't seem to link the stylesheet. Is this because I'm linking a static file in this manner?

<!--[if IE 9]>
    <link rel="stylesheet" type="text/css" href="http://static.tumblr.com/texnbv5/j70mi1pbq/ie9.css" />

Does this have anything to do with the fact that I am linking this stysheet from a different domain instead of the hosted domain?

Also is there anyway I can just single out the line that needs to be adjusted? Is it possible for me to place a if statement in the css portion of my site

<!--[if IE 9]<style>#Content-right{margin:-1000}</style>
<![endif]-->
Community
  • 1
  • 1
DieVers
  • 49
  • 1
  • 9

3 Answers3

1

it's not working because you didn't close your comment tag. It has nothing to do with cross-domain css file fetching, which is entirely legal.

<!--[if IE 9]>
    <link rel="stylesheet" type="text/css" href="http://static.tumblr.com/texnbv5/j70mi1pbq/ie9.css" />

should be <!-- [if IE 9] -->

Also... what engine is supposed to be acting on this IF?

Yevgeny Simkin
  • 26,055
  • 37
  • 127
  • 228
0

There is a very interesting article on just this topic. It addresses the need/desire to isolate browser specific CSS without having to create an entire CSS file. There are also a number of benefits to the approach. I have utilized it for a number of years due to my own needs and was unaware until recently that such analysis had been performed on the technique.

Here is the link: Conditional Stylesheets vs. CSS Hacks

Other Things of Note:

Positioning of your Stylesheets is very important in CSS. Since we can't see your other calls and you are using a separate stylesheet, it is important that you place the conditional statement under your standard stylesheet.

Example

<link rel="stylesheet" href="path/to/standard.css" />
<!--[if IE 9]-->
    <link rel="stylesheet" href="http://path/to/ie9.css" />
<!--[endif]-->

This is because CSS uses the styles that were loaded last if there is a conflict. I only mention this because it could be affecting you results as it is a common mistake.

Fuzzical Logic
  • 12,736
  • 2
  • 28
  • 58
  • I think I tried that in the beginning @Fuzzical. I just tried a few tips from [this](http://css-tricks.com/how-to-create-an-ie-only-stylesheet/) article, but they don't seem to work either. I have taken a look at another site that does not seem to work correctly in IE9 either. – DieVers Feb 11 '13 at 08:57
  • @reinder. Should I try positioning it at the center top instead? – DieVers Feb 11 '13 at 09:03
  • You guys were right. I went back to the code and added in the correct code and now they seemed to be linked. Thank you very much. – DieVers Feb 11 '13 at 09:08
0

Try this code

<!--[if lt IE 9]>
        <link rel="stylesheet" href="http://static.tumblr.com/texnbv5/j70mi1pbq/ie9.css" />

<![endif] -->

I hope you work it

Xtoxico
  • 10
  • 2