CodeIgniter Forums
access base_url() in stylesheet - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: access base_url() in stylesheet (/showthread.php?tid=24255)



access base_url() in stylesheet - El Forum - 11-04-2009

[eluser]ranjitbd[/eluser]
Code:
// how to access base_url() in stylesheet

// suppose the following class is in a css file

.mediatabs a:hover{
background-image:url(image/tabonbtn.gif);
}
// i want to set the base_url() before the image



access base_url() in stylesheet - El Forum - 11-04-2009

[eluser]derekmichaeljohnson[/eluser]
Structure your directories like so:

Code:
- Application
- Public
  - CSS
  - Images
  - JS
- System

Then in your CSS you can do this:

Code:
a {
    background-image: url(../images/something.png);
}