Housy Posted April 13, 2011 Share Posted April 13, 2011 HelloI have a width problem in IE and i wanted to solve this problem with <style type="text/css">ie code</style>, but my page is empty, if i use that code, it doesn't even load.If i put {literal} before <style> and {/literal} after </style>, then the shop loads normally, except the css code is ignored.What is the proper way to use <style> within <head> section in header.tpl?Thank you,Housy Link to comment Share on other sites More sharing options...
Housy Posted April 14, 2011 Author Share Posted April 14, 2011 Hello angora =)I also forgot to mention that i have to check, if user browser is Internet Explorer, then the css code is executed, so your example is not an option.I want to use the code below: <!--[if IE]><style type="text/css">div.myaccount .block_content { width: 162px; }</style>How to get that code work properly? If i put {literal} within <style> then it doesn't work, because of the IE comments.What should i do?Thanks,HousyFirst, consider adding rules to your external global.css stylesheet rather than placing them inline within header.tplThis format, I think (untested) would be properly parsed by Smarty:[b]<style type="text/css">{literal}body { blah blah }anudder css rule { blah blah }{/literal}</style>[/b] Link to comment Share on other sites More sharing options...
Housy Posted April 15, 2011 Author Share Posted April 15, 2011 It doesn't work :-S My site loads normally, if i use that code, but it doesn't work for the IE browser, like the code would be ingored, like it wouldn't even exist.What else should i try, you have any other idea?Thanks for your help man,Housy The literal tags are just needed to bracket/preserve the } { chars(so smarty doesn't attempt to parse them a "smarty tag" delimiters.Have you tried this:<!-- [if IE] --><style type="text/css">{literal}body { blah blah }anudder css rule { blah blah }{/literal}</style><![endif] --> Link to comment Share on other sites More sharing options...
Housy Posted April 15, 2011 Author Share Posted April 15, 2011 Angora, your code works properly. I did one little mistake. Instead of .block_content i had to put div.block_content, so thanks for your help.Housy Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now