0

我试图在文档开头获取这些行

<!doctype html public "✰">
<!--[if lt IE 7]> <html lang="en-us" class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>    <html lang="en-us" class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>    <html lang="en-us" class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html lang="en-us" class="no-js"> <!--<![endif]-->

  <head>
    <meta charset="utf-8">
    ....

来自 html5boilerplate。

我怎样才能用打字稿做到这一点?

我试过

config.doctype = html_5

这可以使用干净的元字符,但我不能添加条件

另一方面,有这个选项:http ://typo3.toaster-schwerin.de/typo3_english/2011_03/msg00014.html但后来我失去了“干净”的字符集,并且有了更长更丑的字符集。

我知道这并没有真正的区别,但我希望我能拥有元字符集标签的短版本。

有没有办法拥有这一切?

4

3 回答 3

1

看看扩展 html5boilerplate(TER 中的 EXT:html5boilerplate)。

它支持条件注释,也可以通过TypoScript 设置中的选项进行配置

于 2012-03-27T21:42:10.983 回答
0

我就是这样做的;

(我在搜索时在某个地方找到了答案,但不记得在哪里)

# conditional comments around HTML tag
config {
    htmlTag_stdWrap {
        setContentToCurrent = 1
        cObject = COA
        cObject {
            temp = TEXT
            temp.addParams.class = no-js
            temp.append = TEXT
            temp.append.char = 10
            temp.current = 1

            10 < .temp
            10.addParams.class = no-js ie6 ltie8 ltie9 ltie10
            10.wrap = <!--[if lt IE 7 ]>|<![endif]-->

            20 < .temp
            20.addParams.class = no-js ie7 ltie8 ltie9 ltie10 iefix
            20.wrap = <!--[if IE 7 ]>|<![endif]-->

            30 < .temp
            30.addParams.class = no-js ie8 ltie9 ltie10 iefix
            30.wrap = <!--[if IE 8 ]>|<![endif]-->

            40 < .temp
            40.addParams.class = no-js ie9 ltie10
            40.wrap = <!--[if IE 9 ]>|<![endif]-->

            50 < .temp
            50.wrap = <!--[if !(IE)]><!--> | <!--<![endif]-->
        }
    }
}
于 2013-11-13T13:10:34.597 回答
-1

使用打字条件怎么样?

config.htmlTag_setParams = class="no-js"
[browser = < msie7]
config.htmlTag_setParams = class="no-js ie6 oldie"
[global]
[browser = msie7]
config.htmlTag_setParams = class="no-js ie7 oldie"
[global]
[browser = msie8]
config.htmlTag_setParams = class="no-js ie8 oldie"
[global]
于 2013-03-07T19:58:25.600 回答