-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I have a Window class that generates dinamic pages, I need to add a css style reference:
<link rel="stylesheet" type="text/css" href="stiles.css"/>
If I do it with
Style s = new Style("stiles.css");
window.appendChild(s);
It works but if I see the source code of the generated html the line:
<link rel="stylesheet" type="text/css" href="/elsotano/estilos/elsotano.css"/>
appears inside some div tags and not in the head part. Is there any way to append the style directly to the Page component?
Thanks
Try this.
s.setDynamic(true);
You can also specify it into lang-addon.xml directly.
For example,
<language-addon> <!-- The name of this addon. It must be unique --> <addon-name>myaddon</addon-name> <!-- Which language this addon will be added to --> <language-name>xul/html</language-name> <stylesheet href="/mystyle.css" type="text/css"/> </language-addon>
Hi,
first of all thanks for your tips!
To esdlbt: How can I set css style for all pages in a desktop. Of course I can cycle all pages calling Executions.getCurrent().getDesktop().getPages(), but since applying style should be a very basic thing in the web world, I'm looking for more elegant solution.
To jumperchen: How can I have multiple language-addon. Probably I didn;t search right, but I didn't find it yet.
Thanks,
Pavlin
Please take a look at the guide
Asked: 2008-10-07 20:07:49 +0800
Seen: 786 times
Last updated: Aug 25 '10