Problem setting css style using relative path

P

PeterKellner

I'm having trouble setting a background style in a master page. The
declaration in the master page looks like this:

<div id="header_image" runat="server" style="background: transparent
url(images/bg_header.jpg) repeat-x scroll 0% 0%;;cursor: pointer;">

</div>

I tried adding runat="server" as well as changing the url to
~/images/bg_head.jpg but that didn't work.

Any suggestion on how to make the bg_header.jpg work on a master that
can be referended from aspx pages in subdirectories?

Thanks
Peter Kellner
http://peterkellner.net
 
M

msnews.microsoft.com

~ is resolved using ResolveClientUrl(). As there is nothing in the CSS that
uses this routine, it will fail.

A couple of solutions.

1. Create the master page for the upper level and then another for indention
(a level off root)

2. Create the image link from web root, which means, for virtual
directories, you use the name of the virtual directory in the link. This
works, although it is not too elegant.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think Outside the Box!
*************************************************
 
P

PeterKellner

~ is resolved using ResolveClientUrl(). As there is nothing in the CSS that
uses this routine, it will fail.

A couple of solutions.

1. Create the master page for the upper level and then another for indention
(a level off root)

2. Create the image link from web root, which means, for virtual
directories, you use the name of the virtual directory in the link. This
works, although it is not too elegant.

Hi,

I don't quite understand what you mean by #2. Are you suggesting
spelling out the domain name in the css file? If so, I think that
would mean I'd have to change that each time I moved from one domain
to another (like testing to non-testing).

If you could explain, that would be a great help.
Peter Kellner
http://peterkellner.net
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top