简体   繁体   中英

FF extension XUL image display

If I want to show an image in my sidebar. How can I do that? I tried to do the following to no avail:

According to this: https://developer.mozilla.org/en/XUL_Tutorial/Adding_Labels_and_Images

If I add this code into my ff-sidebar.xul file:

XUL:
 <image id="image1"/>

Style Sheet:
 #image1 {
   list-style-image: url("chrome://findfile/skin/banner.jpg");
 }

The Image should be displayed. Did I pick the wrong file?

best, US

That's an example if your extension is registered in chrome with findfile:

These images come from within the chrome directory, in the skin for the findfile package.Because images vary by theme, you would usually place images in the skin directory.

And in introduction to the tutorial it says:

This tutorial will demonstrate creating a simple find file user interface, much like that provided by the Macintosh's Sherlock or the find file dialog in Windows.

So that example is in the context of the tutorial.

You need to provide it an image in your skins folder and in css use:

list-style-image: url("chrome://yourext/skin/yourfilename.jpg");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM