Welcome Guest, Not a member yet? Register   Sign In
How to load images called from css file
#1

[eluser]evilphp[/eluser]
hi all
i am new to codigniter. i am using the asset helper file. my assests folder is situated
http://localhost/project/assets .now i am using <?php $this->load->helper('asset'); echo css_asset('register.css'); ?> the code works fine. but i am calling a background image file in register.css. here is its code
.registerdiv
{
color:green;
margin-left:200px;
margin-right:200px;
background-image:url('11.jpeg');
}
.abc
{
background-color:yellow;

}

the background image is stored in assets/css folder please help me how can i show background image. i think there is problem with url of the image.
please guide thanks
#2

[eluser]Met[/eluser]
images are relative to the location of the CSS file.

for

background-image:url(‘11.jpeg’);

to work, the images must be in the same directory as the css.
#3

[eluser]evilphp[/eluser]
Thank you. i was using wrong extension jpeg instead of jpg. images are in the same folder eg
assets/css/11.jpg but i want store images on the assets/images folder how can i call images from assets/images from assets/images/css/register.css . an example would be really appreciable




Theme © iAndrew 2016 - Forum software by © MyBB