是否可以在b:if条件选择中同时包含HTTP和https链接的条件。
<b:if cond='data:blog.url == "http://www.your-site.com/p/contact-us.html"'>
<link href='https://xxxxxx.com/contact.css' rel='stylesheet' type='text/css'/>
<b:else/>
<b:if cond='data:blog.url == "https://www.your-site.com/p/contact-us.html"'>
<link href='https://xxxxxx.com/contact.css' rel='stylesheet' type='text/css'/>
</b:if>
</b:if>
这是我如何在网站的HTTP和https版本中加载此CSS的方式。有没有没有办法做的单一方法?
答案 0 :(得分:1)
您可以使用b:elseif
标签来检查多个条件。
<b:if cond='data:blog.url == "http://www.your-site.com/p/contact-us.html"'>
<link href='https://xxxxxx.com/contact.css' rel='stylesheet' type='text/css'/>
<b:elseif cond='data:blog.url == "https://www.your-site.com/p/contact-us.html"'/>
<link href='https://xxxxxx.com/contact.css' rel='stylesheet' type='text/css'/>
</b:if>
答案 1 :(得分:0)
<b:if cond='data:blog.url contains "//www.your-site.com/p/contact-us.html"'>
<link href='https://xxxxxx.com/contact.css' rel='stylesheet' type='text/css'/>
</b:if>