473,405 Members | 2,310 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Problem setting css style using relative path

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
Jul 29 '06 #1
2 1750
~ 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!
*************************************************
"PeterKellner" <pk**********@73rdstreet.comwrote in message
news:47********************************@4ax.com...
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

Jul 29 '06 #2
On Sat, 29 Jul 2006 16:03:25 -0500, "msnews.microsoft.com"
<No************@comcast.netNoSpamMwrote:
>~ 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
Jul 30 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Aaron Prohaska | last post by:
I have just run into a problem where I have a page that posts back to itself to execute code, except when the page does the post back it somehow executes code that is in our home page for the site....
6
by: B McDonald | last post by:
Hi. I am trying to straighten out some DIV issues in the rendering of my no-tables CSS website. Right now the biggest issue is trying to render 2 columns several DIVs deep in the box model for my...
5
by: | last post by:
Hi, I'm trying to use the cookie munging session handling behaviour of asp.net instead of cookies themselves as I'm finding quite a few people are barring cookies (especially AOL users). If I...
7
by: Nilesh | last post by:
I am using background-image attribute in a CSS file and linking the CSS file to aspx page. But strangly, background-image attribute is not working for relative URL. e.g. If I apply following css...
2
by: george.leithead | last post by:
Hi all, I have a very strange problem! In following Web page (which is generated from a CMS System), the navigation to the left 'dissapears' when you roll the mouse over the links? It does not...
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
0
by: whairs01 | last post by:
Could someone help me and telling me how to get my 3 column web page to resize correctly in IE7. When trying to reside my my web page I can only get it to resize to a point before the 2 and 3...
1
by: gnewsgroup | last post by:
I have a user control called Footer.ascx, in which a background image is inserted like so: <div id="footerdiv" style="background-image:url('Images/ mybackground.jpg');...
4
chathura86
by: chathura86 | last post by:
i have created some php classes in deferent folders which requires each other i have given relative paths relative to those files i used require_once() but when i use those class in a file...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.