0

在我的xul文件中,我有一个简单的方案:

<tabpanel>
    <vbox>
        <description>&spat.options.label.text;</description>
        <grid>
            <columns>
                <column/>
                <column flex="2"/>
            </columns>
            <rows>              
                <row>
                    <label.../>
                </row>
            </rows>
        </grid>
    </vbox>
</tabpanel>

dtd 实体引入了很长的文本字符串。

我似乎无法对描述中的文字进行任何类型的自动换行。

如果我将描述移出标签面板,它将很好地包装。但如果它在标签面板中,它会被截断(截断)。我在没有标签面板的网格中尝试了相同的操作,但遇到了同样的问题。

如何在描述中获得自动换行?

4

2 回答 2

0

那么,一种解决方案是在 css 中为标签添加一个width属性。<description>

于 2012-11-29T04:49:39.623 回答
0
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<box orient="{*horizontal | vertical}">
<description id="desc" style="width: 300px"></description>
<script type="application/x-javascript">
<![CDATA[
document.getElementById('desc').textContent = "This is a long section of dynamic message text that will word wrap";
]]>
</script>
</box>
</window>

在此处输入图像描述 /// I don't want to claim this as a solution, just to give an exmaple,i have posted this////

于 2012-11-29T19:36:43.927 回答