[if lt IE 9] 的 Slim 模板引擎语法
我使用 slim 作为视图模板引擎 http://slim-lang.com/
你会如何写下面的文章slim 的代码?
谢谢
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
I use slim as view template engine http://slim-lang.com/
How would you write the following piece of code with slim?
thanks
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
应该使用/!
It should use /!
浏览文档github-slim-template/slim我发现:
IE条件comment /[...]
呈现为
在您的情况下,您可以编写:
Looking through the documentation github-slim-template/slim I found:
IE conditional comment /[...]
renders as
In your case you could write:
查看Slim的Slim::Parser源代码,似乎可以这样做,虽然我没有尝试过。
Looking at Slim's source code for Slim::Parser, it seems that you can do it this way, although I haven't tried.
我遇到了这个问题,寻找一种在 Slim 中执行下层显示和下层隐藏条件的方法。
首先确保您清楚这两种类型的条件句之间的区别。 CSS-Tricks 有一篇关于 downlevel-hidden 和 downlevel-reveal 条件 的精彩文章。
此代码创建一个下层隐藏条件。
但是如果你想要一个下层显示条件,你需要像你不在 slim 中工作时那样编写它。
我在尝试在 Slim 中使用 HTML5 Boilerplate 时遇到了这个问题。 这个要点展示了我解决这个问题的方法。
如果 slim 有编写下层显示条件的语法,我不知道。
I ran across this question searching for a method to do both downlevel-reveal and downlevel-hidden conditionals in Slim.
First make sure you are clear on the difference between these two types of conditionals. CSS-Tricks has a great post about downlevel-hidden and downlevel-reveal conditionals.
This code creates a downlevel-hidden conditional.
But if you want a downlevel-reveal conditional you need to just write it as you would if you were not working in slim.
I encountered this issue while trying to use HTML5 Boilerplate in Slim. This Gist shows my approach to the issue.
If slim has a syntax for writing downlevel-reveal conditionals I am not aware of it.