linking images from css |
[eluser]Unknown[/eluser]
hi, my css files are stored in /css/960/example.css and how do i link images from css so they can be found each time? for example for background-image:url(images/image.gif) the problem is if i have some deep page like http://domain.com/news/article/123/full-view the the image is not properly linked because the path is wrong... remember that i don't want to use absolute paths only relative ones..
[eluser]Tripic[/eluser]
have you tryed link tag in html helper? http://ellislab.com/codeigniter/user-gui...l#link_tag
[eluser]Unknown[/eluser]
[quote author="Tripic" date="1278974827"]have you tryed link tag in html helper? http://ellislab.com/codeigniter/user-gui...l#link_tag[/quote] i know how to load the css but how do i get proper image url's from INSIDE the CSS?
[eluser]Brandon Beasley[/eluser]
Is this what you are asking? Code: <img src="<?=base_url() ?>images/test.png" alt="test PNG" /> base_url() will be pulled from settings in config.php
[eluser]danmontgomery[/eluser]
In a .css paths are always relative to the css file. in /css/960/example.css, Code: background-image: url('images/image.jpg'); Would be looking for /css/960/images/image.jpg
[eluser]InsiteFX[/eluser]
Code: css InsiteFX |
Welcome Guest, Not a member yet? Register Sign In |