Welcome Guest, Not a member yet? Register   Sign In
Best location to store css & img
#8

[eluser]Frychiko[/eluser]
Assuming you have /public/img for your image folder:

Use the following inside a <IMG> tag.
Code:
$image = base_url()."public/img/image.png";

Example:
Code:
<img src='&lt;?=base_url()."public/img/image.png"?&gt;'>

Use the following to test whether a file exists
Code:
$file = "./public/img/image.png";

For CSS images it's relative to your CSS folder, so if you have
Code:
public/
img/
css/
This would be how to do it:

Code:
a.go_back {
    background:url(../img/arrow_undo.png) no-repeat 2px center;
    padding:0.3em;
    padding-left:20px;
    text-decoration:none;    
}


Messages In This Thread
Best location to store css & img - by El Forum - 08-06-2008, 01:44 PM
Best location to store css & img - by El Forum - 08-06-2008, 04:21 PM
Best location to store css & img - by El Forum - 08-07-2008, 02:36 AM
Best location to store css & img - by El Forum - 08-07-2008, 03:12 AM
Best location to store css & img - by El Forum - 08-07-2008, 10:03 AM
Best location to store css & img - by El Forum - 08-13-2008, 10:13 AM
Best location to store css & img - by El Forum - 08-14-2008, 10:10 AM
Best location to store css & img - by El Forum - 08-14-2008, 11:24 AM
Best location to store css & img - by El Forum - 08-15-2008, 10:57 AM



Theme © iAndrew 2016 - Forum software by © MyBB