Login

Username

Password





Register   Reset password

Get Cuyahoga at SourceForge.net. Fast, secure and Free Open Source software downloads

Forum

Welcome Guest Search | Active Topics | Members

using images in css Options
kuduk
Posted: Thursday, July 2, 2009 7:31:18 AM
Rank: Newbie
Groups: Member

Joined: 7/2/2009
Posts: 3
Points: 9
I try to customize my css template and convert it to cuyahoga template. But I could not use "background:url(); " tag. Is there a any technical restriction to use image url in css?

I check both
Code:
background:url(~/Templates/jet/Images/lft_pic1.gif);
and
Code:
background:url(<%= ResolveUrl("~/Templates/jet/Images/header.gif") %>);
and
Code:
background:url(Templates/jet/Images/header.gif);
in css.

Do you have any opinion?

martijnb
Posted: Thursday, July 2, 2009 11:23:13 AM

Rank: Administration
Groups: Administration , Member

Joined: 12/30/2004
Posts: 1,674
Points: 1,824
Location: Wageningen (NL)
In the css you should always use relative urls to the images (relative to css file itself):

Code:

background: url(../images/mybg.png);
Constructor
Posted: Thursday, July 2, 2009 12:52:57 PM
Rank: Administration
Groups: Administration , Member

Joined: 10/7/2008
Posts: 505
Points: 1,515
Or go from the root beginning with '/' when referencing in templates etc

Code:
background:url(/Templates/jet/Images/header.gif);


../ relative is what I use though.
kuduk
Posted: Friday, July 3, 2009 2:07:01 AM
Rank: Newbie
Groups: Member

Joined: 7/2/2009
Posts: 3
Points: 9
martijnb wrote:
In the css you should always use relative urls to the images (relative to css file itself):

Code:

background: url(../images/mybg.png);



yes, correct that's worked. thanks for your help
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

Yet Another Forum.net version 1.9.0 running under Cuyahoga.
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.