开发者

define the height of an image in xul extension

开发者 https://www.devze.com 2022-12-16 18:52 出处:网络
My extension is an overlay that has some images inside a toolbar. I need to display these images small (about 15px), but they render always at the sam开发者_StackOverflowe height of toolbar.

My extension is an overlay that has some images inside a toolbar. I need to display these images small (about 15px), but they render always at the sam开发者_StackOverflowe height of toolbar. I've already tried to define height and maxHeight of image and of hbox where them are palced but it doesn't work.

here is the piece of code:

...

<toolbox id="navigator-toolbox">
    <toolbar id="my-toolbar">
        <label>images:</label>
        <hbox id="rsour_inputRating">
            <image id="rsour_1" />
            <image id="rsour_2" />
            <image id="rsour_3" />
            <image id="rsour_4" />
            <image id="rsour_5" />
        </hbox>
    <toolbarseparator />

...


The correct way is to use -moz-box-align in CSS, or align attribute in xul, so the image doesn't stretch vertically:

#rsour_inputRating{
  -moz-box-align:center;
}

#rsour_inputRating img{
  list-style-image : url("chrome://...");
  width:20px;
  height:15px;
}


At the top of the file, add:

<?xml-stylesheet href="chrome://your_ext_name/content/cssFile.css" type="text/css"?>

Then in the css file:

#rsour_inputRating img  {height:15px;}
0

精彩评论

暂无评论...
验证码 换一张
取 消