开发者

codeigniter css styles

开发者 https://www.devze.com 2023-03-21 22:13 出处:网络
The question is about using css stylesheets in your assets folder within the code igniter framework.If I want to reference a certain image for a css style, lets say for instance, background: url(\'../

The question is about using css stylesheets in your assets folder within the code igniter framework. If I want to reference a certain image for a css style, lets say for instance, background: url('../images/some_image.gif'). How should I reference this image, and what url shoul开发者_如何学God I provide. I'd like to do this in a way that I can put my image file in the image folder within assets.


There's no difference in regards to this because you're using Codeigniter, you can use /absolute/paths, full URLs, or probably the easiest way - relative urls.

The url to the image can just be relative to the <link>ed CSS file.

Example:

-assets
   -css
      screen.css
   -images
      bg.png

In your HTML:

<link rel="stylesheet" type="text/css" href="/assets/css/screen.css">

From screen.css:

background:url(../images/bg.png);
0

精彩评论

暂无评论...
验证码 换一张
取 消