html - CSS 未应用于 XUL 窗口 HTML 内容

标签 html css firefox-addon xul background-color

我正在开发一个非常简单的 Firefox 扩展,它将记录信息并将其动态附加到 XUL 窗口中的基本 HTML 表中。

除了 HTML 表格的 CSS 样式外,一切正常。它们都没有被应用。我在某处读到将 -moz-appearance: none; 添加到 CSS,但它仍然不起作用。有人看出这组 XUL 和 CSS 文件有什么问题吗?

XUL 文件

<?xml version="1.0"?>
<?xml-stylesheet href="chrome://rmtagfinder/content/log_window/log_window.css" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://rmtagfinder/locale/translations.dtd">

<window id="rm-tag-finder-log-window"
    title="&rmtagfinder.app.name;"
    xmlns:html="http://www.w3.org/1999/xhtml"
    xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

<vbox flex="1" style="overflow:auto" >

<html:table cellspacing="1" cellpadding="4" bgcolor="#CCCCCC" border="0" id="rm-tag-finder-log-window-html-table">
    <html:thead>
    <html:tr class="tbl_header">
        <html:td width="100">Time</html:td>
        <html:td width="100">Domain</html:td>
        <html:td width="200">Request Made</html:td>
        <html:td width="200">Referer</html:td>
        <html:td width="200">Decoded Info</html:td>
     </html:tr>
    </html:thead>
    <html:tbody></html:tbody>
</html:table>

</vbox>
</window>

CSS 文件

@import url("chrome://global/skin/");
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");

.tbl_header {
    -moz-appearance: none;
   font-weight: bolder;
   font-family: Arial, Verdana, Helvetica;
   font-size: 8pt;
   color: #fcfcfc;
   background-color: #4F80AB;
}

tr {
    vertical-align: top;
}

td {
    vertical-align: top;
}

最佳答案

我很快就开始工作了,这是解决方案。我必须将以下行添加到 CSS 文件中,以便它能够识别 html 命名空间中的 CSS 样式:

@namespace html url("http://www.w3.org/1999/xhtml");

关于html - CSS 未应用于 XUL 窗口 HTML 内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8329890/

相关文章:

html - SVG 舍入错误

css - 修改 twitter bootstrap navbar

php - 使用 phpmailer 发送邮件时没有获取 CSS

javascript - 无法在 jqueryUI 中重新绑定(bind)可拖动事件

javascript - 如何获取网络扩展图标来调用javascript

firefox - 开发一个适当的Firefox扩展(不是首先通过编码到xpi)?

javascript - 如何在 localStorage javascript 中堆叠多个数组?

php - sort with SELECT drop down asc desc 连接到数据库

javascript - 安全 jQuery Mobile + Phonegap

html - FF 扩展 - 垂直对齐 Div 内的图像(使用最大高度/最大宽度)