背景位置问题 [英] background-position question

查看:58
本文介绍了背景位置问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

> 此页面我一直在努力 ,此列的标题为出价x询问": http://www.sellmycalls.com/so-bg-pos.png

On this page I"ve been working on forever, I have this column headed "Bid x Ask": http://www.sellmycalls.com/so-bg-pos.png

在每个单元格背景中应该有一个条形图,用于传达单元格中数字彼此的比率.

in each of whose cell backgrounds there is supposed to be a bar chart that conveys the ratio of the numbers in the cell to each other.

因此,在每个单元格中,我都有一个背景色:灰色;和背景图片:全白;我无法在灰色背景上正确放置(足够大)的图像.实际上,在当前版本中,该图像完全没有显示.

So in each cell I have a background-color: gray; and a background-image:all-white;. I can't properly position the (plenty big enough) image on the gray background. In fact, in its current incarnation, the image doesn't show up at all.

如何正确设置图像的背景位置?列顶部的< td>的样式是这样的:

How can I properly set the background-position of the image? The top <td> in the column is styled this way:

   <td class="main_td bxa bxa_val"
   style="background-color: #ecf1ef;
          background-image:url('http://www.sellmycalls.com/pics/cell/bxa-white.png');
          background-repeat:repeat-x repeat-y;
          background-origin: 0px 0px;
          background-attachment:fixed;
          background-position:53px 0px;
     -moz-background-position:53px 0px;
  -webkit-background-position:53px 0px;
   -khtml-background-position:53px 0px;
  -o-user-background-position:53px 0px;">
    <div>&nbsp;543 x 470</div></td>

非常感谢您的帮助!

推荐答案

您的图像是 49x1px ,我认为该图像正在显示,但是,使用Firebug,您的 TD 显示了一种样式的 background-repeat:repeat-x; X不是Y,如您在上面的示例代码片段中所示.

Your image is 49x1px which I think is showing, however, with Firebug your TD shows a style of background-repeat:repeat-x; X not Y as you show in your example code snippet above.

更新:

尝试

style="background-color:#ecf1ef;
       background-image:url('http://www.sellmycalls.com/pics/cell/bxa-white.png');
       background-position:50px 0px;
       background-repeat:repeat-y;"

  • 您无法调整图像的尺寸,因此(1)始终使图像至少与TD本身一样宽(即宽于49像素),并且始终将背景图像用作右侧栏,而背景则使用-左侧栏的颜色.我希望一切都清楚
  • 这篇关于背景位置问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆