Jump to content

[SOLVED] Page doesn't load, when i use <style> in the header.tpl?


Recommended Posts

Hello

I 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

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,
Housy

First, consider adding rules to your external global.css stylesheet rather than placing them inline within header.tpl

This 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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...