用户自定义控件的背景图片无法正常显示

来源:互联网 发布:发改委 大数据 编辑:程序博客网 时间:2024/06/06 02:31

引用用户自定义控件或者母板的时候,如果与所引用文件不再痛一个目录下的话,文件中控件所使用的背景图片无法正常显示。

解决方法如下:

把背景图片写在css里面。

比如: <table id=tb1  background=../images/top>

              <table id=tb2 background=../images/bottom>

可以改为:

          style.css里文件中加入

           .top {   background:url(../images/top)}

           .bottom {   background:url(../images/bottom)}

    在文件中引用style.css

   然后: <table id=tb1  class=top>

              <table id=tb2 class=bottom>

原创粉丝点击