我想在web文档的头部插入dynamiccaly的一些HTML应用程序。我试图添加:
$("head").append("<style type=\"text/css\"> @import \"http://ajax.googleapis.com/ajax/libs/dojo/1.5/dojox/grid/resources/claroGrid.css\";.container { text-align: center; margin: 10px; } .info { margin: 10px; }</style>");
但看起来它不起作用......
你知道是否有可能在头部应用程序中添加dynamiccaly一些内容?
非常感谢,
蝙蝠
答案 0 :(得分:1)
答案 1 :(得分:0)
我认为您的问题可能是您错过了导入网址周围的url()
位。您也不需要网址周围的引号。请参阅此参考:http://htmlhelp.com/reference/css/style-html.html#importing
尝试将其更改为:
$("head").append('<style type="text/css"> @import url(http://ajax.googleapis.com/ajax/libs/dojo/1.5/dojox/grid/resources/claroGrid.css); .container { text-align: center; margin: 10px; } .info { margin: 10px; }</style>');