8bitcat
8bitcat

Reputation: 2234

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?!

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;
}

Upvotes: 0

Views: 500

Answers (2)

A1Gard
A1Gard

Reputation: 4168

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;

Upvotes: 1

crowjonah
crowjonah

Reputation: 2878

The background-image CSS property should only be used to define the url of the image used.

no-repeat belongs to the background-repeat property, and left corresponts to background-position. background groups all of those, so:

change background-image: to background:, or split it up:

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

Upvotes: 5

Related Questions