【问题标题】:Joomla: addStyleDeclaration inserts commented stylesJoomla:addStyleDeclaration 插入注释样式
【发布时间】:2010-11-03 18:38:18
【问题描述】:

我的 Joomla 文章使用 Jumi 来包含一个 php 文件。

php文件使用$document->addStyleDeclaration好像都可以,只不过添加的样式被方法注释掉了!新样式被 HTML cmets 包围。

Joomla 1.5.21。建议赞赏!

php file:
<?php
defined('_JEXEC') or die( "Direct Access Is Not Allowed" );

$style = <<<FOOBAR
    @import url("http://foo.css");
    .gfg-entry {height: 6.9em;}
    #feed-control {width : 500px; padding : 10px;}
FOOBAR;

$document =& JFactory::getDocument(); 
$document->addStyleDeclaration ($style);
?>

下面是添加到页面头部部分的内容。 注意添加的 cmets 括号:

<style type="text/css"> 
<!--
@import url("http://foo.css");
.gfg-entry {height: 6.9em;} 
#feed-control {width : 500px; padding : 10px;}
-->
</style> 

【问题讨论】:

    标签: joomla joomla1.5


    【解决方案1】:

    糟糕,这是一项功能,而不是错误。 Joomla 插入 以使生成的页面原始 XHTML。

    浏览器会忽略样式标签中的 HTML 样式 cmets。样式标签使用 /* 用于 cmets */

    【讨论】:

      猜你喜欢
      • 2010-10-07
      • 2020-11-02
      • 2020-02-16
      • 1970-01-01
      • 1970-01-01
      • 2011-03-18
      • 2015-01-18
      • 2017-10-29
      • 1970-01-01
      相关资源
      最近更新 更多