html5shiv icon indicating copy to clipboard operation
html5shiv copied to clipboard

Shiv not working in my site, what might be conflicting with it?

Open maz123 opened this issue 12 years ago • 6 comments

Hi there, I have used the Shiv on my template and it's not working. Does anyone know of any conflicts that may cause it to stop working. I have included before the css, after the css, and that hasn't helped. I'm not sure what else to try... Many Thanks in advance

http://tinyurl.com/q6kwovp

maz123 avatar Nov 05 '13 14:11 maz123

You should include the shiv immediatelly after all included css and style tags. In your case you should include it immediately after this line of your code:

<!--[if IE 7]><link rel="stylesheet" href="css/font-awesome-ie7.min.css"><![endif]-->
<!--[if lt IE 9]><script type="text/javascript" src="js/html5shiv.js"></script><![endif]-->

dvorapa avatar Nov 05 '13 17:11 dvorapa

If you include it to this right place, it starts behave correctly in IE 9 and partly in IE 8 and lower. For that browsers, I recommend to look for unsupported CSS 3 features in IE 8 and lower, especially @media, advanced selectors and so on (see caniuse.com and try to polyfill some of them). I hope I'll help. Good luck with your project :-)

dvorapa avatar Nov 05 '13 18:11 dvorapa

After changing the placement of the shiv script it doesn't change how it shows in IE8 or 9? Also, I'm not sure if or why unsupported CSS3 is affecting this? maybe I've misunderstood you?

I think it may be something to do with the Dreamweaver templates... when I am attaching a template to a file, its putting this before the doc type declaration.

http://tinyurl.com/q6kwovp

Thanks for your help

maz123 avatar Nov 06 '13 10:11 maz123

I'm using Modernizr so I am I right in saying that I shouldn't need a shiv, respond.js or css3-mediaqueries.js?

Any help muchly appreciated, really stumped! :-(

maz123 avatar Nov 06 '13 13:11 maz123

I tried it and on my IE9 there it didn't work before replacement and it worked after replacement. And sorry, I didn't see the Modernizr. In my opinion there shouldn't be a problem with shiv, because Modernizr also includes the shiv as well, so it isn't necessary to load the second shiv (it could be your problem - two html5shivs!)... But I'm only the human, so I could be wrong. Don't be angry with me :-) I only try to help, but you code is so messy to me, and I don't want to immerse in details of your code...

dvorapa avatar Nov 06 '13 18:11 dvorapa

Oh no, I'm very sorry if my reply came across blunty, I really wasn't meaning it to be, I appreciate your responses. I thought the Shiv in the Modernizr wasn't working so that why I tried putting in another... but it turns out that it does work, my problem lied in the media queries not working... I've added respond.js and now it's working... though I thought that was supposed to included with Modernizr aswell... very strange.

maz123 avatar Nov 07 '13 20:11 maz123