# CSS question



## GSquadron (Feb 27, 2012)

Hi all!
I have a question about this command line in css:
.alex {background: url(1.gif);}
I keep trying and trying but nothing happens and have made this for weeks!
Cannot find an answer why i cannot add a background. 
I need to use the stupid <img src="..." />
Anyone knows the answer?


----------



## W1zzard (Feb 27, 2012)

```
.arrow {
	background: url("http://tpucdn.com/mobile/images/arrow.1.png") no-repeat scroll right center transparent;
	padding-right: 33px;
	display: block;
}
```


----------



## GSquadron (Feb 29, 2012)

doesn't work again!
tried like this:

```
.alex
{  
    background: url("img/1.gif") no-repeat scroll right center transparent;
    padding-right: 33px;
    display: block;
}
```

EDIT: LOL just found the enigma xD


----------



## Aquinus (Mar 1, 2012)

Aleksander Dishnica said:


> doesn't work again!
> tried like this:
> 
> ```
> ...



Try using the background-image css attribute instead.
http://www.w3schools.com/cssref/pr_background-image.asp

I would also use Firebug, Chrome's developer tools, or some other form of dev tools to see if the image is actually getting loaded. Relative paths can have weird behavior if you're sitting behind some apache re-write rules or if you have a permissions issue.

I would also make sure that all the files are readable if you're on a *nix system. I recommend running `chmod a+r /your/dir/here`.

Can you view the image if you load the image path directly in the browser?


----------

