简体   繁体   English

不重复时不显示CSS背景

[英]CSS background does not show up when doing no-repeat

I have written the following css style, it does not work ... And I'm Clueless why?! 我写了以下CSS样式, 它不起作用 ...而且我很无知为什么?!

td.PostiveNumber
{
color:Green;
background-image:url(images/1354052077_arrow_large_up.png) no-repeat left !important;
text-align:right;
z-index:100;
}

I tried this to and it worked, so I thought to myself it's only to set no-reapeat on and position the picture. 我尝试过此方法,并且它起作用了,所以我自己认为这只是在不重复播放的情况下定位图片。

THIS WORKS, but looks buttugly... :( 这项工作,但看起来很笨拙... :(

{
color:Green;
background-image:url(images/1354052077_arrow_large_up.png);
text-align:right;
z-index:100;
}

The background-image CSS property should only be used to define the url of the image used. background-image CSS属性仅应用于定义所用图像的url。

no-repeat belongs to the background-repeat property, and left corresponts to background-position . no-repeat属于background-repeat属性,而left对应于background-position background groups all of those, so: background将所有这些分组,因此:

change background-image: to background: , or split it up: background-image:更改为background:或将其拆分:

background-image:url(images/1354052077_arrow_large_up.png);
background-repeat: no-repeat;
background-position: left;

You have two way: 您有两种方法:

one : 一:

background-image:url(images/1354052077_arrow_large_up.png) no-repeat left !important;

change to : 改成 :

background:url(images/1354052077_arrow_large_up.png) no-repeat left !important;

or 要么

use this way : 使用这种方式:

    background-image:url(images/1354052077_arrow_large_up.png) ;
    background-repeat:no-repeat ;
    background-position: left;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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