Jaz*_*Jaz 5 sharepoint html5 master-pages boilerplate
我想在Boilerplate HTML模板中使用Paul Irish的条件评论:
<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]> <html lang="en" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]> <html lang="en" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]> <html lang="en" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
Run Code Online (Sandbox Code Playgroud)
在SharePoint 2010母版页中.我读过'有条件的评论在SP2010中并不总是那么好用'.(不知道这意味着什么!)建议是使用:
<SharePoint:CSSRegistration Name="foo.css" ConditionalExpression="gte IE 7" runat="server" />
Run Code Online (Sandbox Code Playgroud)
这允许我使用条件来加载特定样式表,但不使用Paul Irish建议的方式使用条件html标记.有没有办法做到这一点,还是只需将Biolerplate中的代码粘贴到Sharepoint主页中?
小智 3
我对 SharePoint 品牌非常陌生,并且遇到了同样的问题。我不是 ASP 开发人员,因此理解某些解决方案有点困难。
我所做的是将 Paul 的条件语句与 HTML 标记一起移至 BODY 标记,它似乎工作得非常完美,而不必弄乱 SP 代码。
<!--[if lt IE 7]> <body class="no-js lt-ie9 lt-ie8 lt-ie7" scroll="no" onload="javascript:_spBodyOnLoadWrapper();"> <![endif]-->
<!--[if IE 7]> <body class="no-js lt-ie9 lt-ie8" scroll="no" onload="javascript:_spBodyOnLoadWrapper();"> <![endif]-->
<!--[if IE 8]> <body class="no-js lt-ie9" scroll="no" onload="javascript:_spBodyOnLoadWrapper();"> <![endif]-->
<!--[if gt IE 8]><!--> <body class="no-js" scroll="no" onload="javascript:_spBodyOnLoadWrapper();"> <!--<![endif]-->
Run Code Online (Sandbox Code Playgroud)
希望有帮助。