JohnMike Posted December 5, 2009 Share Posted December 5, 2009 Hi All, I have included some PHP code to @import in various stylesheets with in a <STYLE></STYLE> element as appropriate. I know that the PHP is constructing the @import statement correctly. I know that the code works perfectly when accessed through firefox. But when accessed through internet explorer 8 the CSS is not imported. Having messed with various snippets I am concluding that IE8 can not action an @import from within the <STYLE></STYLE> element. I must be missing something but I cannot see what. I am looking at a work around but I would dearly love to know IE 8 will not run this script properly. Many Thanks Quote Link to comment https://forums.phpfreaks.com/topic/184064-using-php-to-construct-import-string-to-dynamically-import-style-sheets/ Share on other sites More sharing options...
oni-kun Posted December 5, 2009 Share Posted December 5, 2009 This is an IE problem with HTML, nonetheless you should change the code to this. Lets say you have the following PHP code: <style>@import('<?php echo $CSSDOCUMENT; ?>')</style> Or similar offending code. Remove it and place this in your <head> sections, wherever the template/head allows you to. <LINK href="<?php echo $CSSDOCUMENT; ?>" rel="stylesheet" type="text/css"> Easy enough, and much more compatible. This is a PHP help forum, so there's some code. If you need help placing it just ask. Quote Link to comment https://forums.phpfreaks.com/topic/184064-using-php-to-construct-import-string-to-dynamically-import-style-sheets/#findComment-971764 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.