image url in CSS background-image

Last Reply on Apr 11, 2012 08:51 AM By nedash

Posted on Apr 11, 2012 08:19 AM

hi

 

 I want use calss with this code in css

 

 

.maindiv
{
    background-image:url('image/8.jpg');
    background-repeat:no-repeat;
    height:2600px;
    width:1024px;
    }
 
when i use this class for my div it didn't show image but when i change url address like this
.maindiv
{
    background-image:url('http://localhost:3723/mysite/image/8.jpg');
    background-repeat:no-repeat;
    height:2600px;
    width:1024px;
    }
 
 
it showed my image why?
in past always i use url like this
    background-image:url('image/8.jpg');
and that showed my image but i don't know why  it didn't show my image now?
 
 
 
 

 

Posted on Apr 11, 2012 08:23 AM

try this,

    background-image:url(../image/8.jpg);