本文介绍了如何在 SharePoint 2010 母版页中使用 Paul Irish 的条件注释的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用来自 Boilerplate HTML 模板的 Paul Irish 的条件注释:

I want to use Paul Irish's Conditional comments from the Boilerplate HTML template:

<!--[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]-->

在 SharePoint 2010 母版页中.我读过条件注释在 SP2010 中并不总是那么有效".(不知道那是什么意思!)建议使用:

in a SharePoint 2010 masterpage. I have read 'conditional comments don’t always work so well in SP2010'. (not sure what that means!) The advice is to use:

<SharePoint:CSSRegistration Name="foo.css" ConditionalExpression="gte IE 7" runat="server" />

这允许我使用条件加载特定的样式表,但不能像 Paul Irish 建议的那样使用 Conditional html 标签.有没有办法做到这一点,或者我可以简单地将 Biolerplate 中的代码粘贴到 Sharepoint 母版页中?

This allows me to use a conditional to load a specific stylesheet but not to use the Conditional html tag in the way Paul Irish suggests. Is there a way to do this or can I just simply paste the code from Biolerplate into the Sharepoint masterpage?

推荐答案

我对 SharePoint 品牌非常陌生,并且遇到了同样的问题.我不是 ASP 开发人员,所以理解一些解决方案有点困难.

I am very new to SharePoint branding and was coming across the same problem. I am not a ASP developer so understanding some of the solutions were a little tough.

我所做的是将 Paul 的条件语句和 HTML 标记一起移到 BODY 标记中,它似乎工作得非常完美,而不必弄乱 SP 代码.

What I did was take Paul's conditional statements with the HTML tag and moved them to the BODY tag and it seemed to work just perfect with out having to mess with and SP code.

<!--[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]-->

希望有所帮助.

这篇关于如何在 SharePoint 2010 母版页中使用 Paul Irish 的条件注释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 00:41