473,770 Members | 1,555 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_imag e" runat="server" style="backgrou nd: 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 1762
~ is resolved using ResolveClientUr l(). 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!
*************** *************** *************** ****
"PeterKelln er" <pk**********@7 3rdstreet.comwr ote in message
news:47******** *************** *********@4ax.c om...
I'm having trouble setting a background style in a master page. The
declaration in the master page looks like this:

<div id="header_imag e" runat="server" style="backgrou nd: 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.microso ft.com"
<No************ @comcast.netNoS pamMwrote:
>~ is resolved using ResolveClientUr l(). 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
2309
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. The only reason I know that is happening is because I keep track of the pages executed by the user to see how they have traversed the site. Has anyone every seen anything like this before? Regards, Aaron Prohaska
6
2703
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 index page. If you go to http://galtsvalley.com/newindex.html - you will see the problem area. I've highlighted the relevant blocks with nice, harsh primary colors. Clearly there are positioning problems begetting flow issues - the blocks...
5
3048
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 change the setting in web.config everything seems to work fine as long as I'm using relative paths. The problem is I've got a menuing system that's generated from a site-wide template - so I use a fixed path from the application root - (ie:...
7
5129
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 ..navbar-background { background-image: url(images/menubar.gif); } the image is not appearing on the page. It seems that IE is picking
2
2104
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 do this in all browsers either. I have found it to happen in IE 7 and the latest patched IE 6. I have tried to find out the reason, but keep finding strange behaviour! You will see at the bottom of the HTML, I have a comment. If you follow...
1
6509
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" setting to be "E_ALL", notices are still not getting reported. The perms on my file are 664, with owner root and group root. The php.ini file is located at /usr/local/lib/php/php.ini. Any ideas why the setting does not seem to be having an effect? ...
0
3084
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 columns wrap below the 1 column. I am using a mixer of fliud and liquid layout. Following is my css code that I am using in laying my page out and the HTML program only consist of div statement. html, body { padding: 0; margin: 0;
1
2871
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'); background-position:center; background-repeat:no- repeat;" <!-- My footer content goes here. --</div> This Footer.ascx is under a folder called /UserControls (the leading forward slash indicates the root of the web application, same below).
4
1857
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 outside the class folder i get a error message stating that the path is incorrect i seems like path is setting relative to the page im using those classes not relative to the class which is requiring it.
0
10230
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10058
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10004
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8886
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7416
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6678
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5450
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3972
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.