background-image:url Not working as should

tonelm54
tonelm54 used Ask the Experts™
on
Good morning,
Ive been playing around tring to get the following CSS statment working, and stuck with the "background-image:url", using the following code, it does not draw my backgroun
.divRoundedTopLeft { width:21px; height:21px; background-image:url('../images/RoundedCorners/topLeft.png'); background-repeat:no-repeat; float:left; }

Open in new window


However if I put the image in the same folder, it works fine:-
.divRoundedTopLeft { width:21px; height:21px; background-image:url('topLeft.png'); background-repeat:no-repeat; float:left; }

Open in new window


If I navigate to http://localhoat/images/RoundedCorners/topLeft.png then I can see my image, so doesnt look like an issue with the folder names and me miss-spelling it.

I dont really want to put the images in the same folder as the file, so is it possible to tell it to goto a folder instead?

Any ideas?

Thank you
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Fixer of Problems
Most Valuable Expert 2014
Commented:
Sure, try this.  The two dots '..'/' tell it to look up one level when the directory you want is in the path you're already on.

.divRoundedTopLeft { width:21px; height:21px; background-image:url('images/RoundedCorners/topLeft.png'); background-repeat:no-repeat; float:left; }
                                  

Open in new window

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial