473,698 Members | 2,615 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

can't ref img in theme stylesheet

kpg
Hi all,
I am setting an image on a page and the image is defined in the
stylesheet
unsed a theme folder. Problem is no matter how I define the image url
it does not display.

The site has the following file structure:

root
default.aspx
-App_Themes
--defaultTheme
----SkinFile.skin
----StyleSheet.css
-Images
----bg.jpg

In the style sheet:

img#bg
{
src:url(Images/bg.jpg);
position:fixed;
top:0;
left:0;
width:100%;
height:100%;
}
In default.aspx:

<img id="bg" />
I have tried ..\Images\bg.jp g and ../../Images/bg.jpg also, thinking
I needed to go up one ot two folders first.

I know I've done this in the past using asp controls and there the ~
app root function works fine.

Becuase I'm using the images as a streched background I'm using a
standard HTML img (I suppose the asp:Image may also work, but I
have not tried that yet).

I am sure there is a way to reference images form a stylesheet under
a theme folder, but I can;t seem to make this work.

Any ideas?

Thanks,
kpg
Jun 27 '08 #1
1 1159
kpg
I've answered my own question.

It seems img src cannot be set in CSS. That seems odd to me,
but that seems to be the case. If anyone knows different,
please do tell.

To fmake it work I've changes the HTML img to an asp:Image:

<asp:Image ID="bg" skinID="bgImage " runat="server" />

In the skin file I added:

<asp:Image skinID="bgImage " runat="server" ImageUrl="~/Images/bg.jpg"/>

The stylesheet is the same except I removed the src from img#bg.

Works fine.
kpg

Jun 27 '08 #2

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

Similar topics

1
8000
by: Joey | last post by:
Hello, I have tried to programmatically set the theme for my master page by putting code in a "Page_PreInit" fuction in the master page's code behind. However, when I set a breakpoint there and run the app, the breakpoint is never hit. Of course my theme is not being applied. The above procedure works fine for any content page, but obviously doesn't work for my master page. So, how does one properly and programmatically set a theme...
1
1584
by: gwen.lister | last post by:
Hi! I'm trying to make it so that my basic links have the default style (blue text, underlined) and my asp link buttons always be white. I need this because I am only using linkbuttons in my sidebar which is dark so they need to be white. Can this be done by only making changes to my stylesheet? or am I going to have to create a custom css class and assign it to each linkbutton individually?
0
2220
by: vikramp | last post by:
Hi, I am storing theme in web.config using <pages theme="mytheme"/>. I am then using the following code to read it from my webpage: Configuration config = WebConfigurationManager.OpenWebConfiguration("~"); PagesSection section = (PagesSection)config.GetSection("system.web/pages"); string currenttheme = section.Theme;
1
1743
by: shapper | last post by:
Hello, I created a theme folder where I place my Skin and CSS files. I have 5 files: Base.skin, Base.css, Default.css, Contacts.css, Print.css Base Skin and CSS files should be used on all pages.
2
4422
by: Wayne | last post by:
Does anybody know why my Office 2003 apps including Access have taken on a blue theme when running under Windows Vista irrespective of which "Window Color and Appearance" I choose in Control Panel? It doesn't seem to matter if I'm running Aero or Vista Basic. Access 2000 is not affected and has the bog standard grey toolbars etc. Under XP the blue theme only appeared in Office apps if the blue XP theme was chosen. If another theme...
4
3325
by: Ben | last post by:
Hi, I'm testing theme and dtylesheettheme properties of 'Page' like this: ('test' is a directory of App_Themes). Protected Sub Page_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreInit 'Page.Theme = "test" Page.StyleSheetTheme = "test" End Sub
0
1369
by: Jeff | last post by:
ASP.NET 2.0 I have problem with the markup and skin file below, this table isn't displayed. webpage <asp:Table ID="compose" SkinID="compose" runat="server"> <asp:TableRow> <asp:TableCell SkinID="recipient">fffff</asp:TableCell> </asp:TableRow>
2
1431
by: Redhairs | last post by:
The theme item(images,css,skin file) of each theme are under single theme folder of App_Theme. if there are some css or image files which are shared and used by every/some theme, where should I put them ?
1
2364
by: Henry Stock | last post by:
I am having trouble referencing a theme in my ASP.NET project. I was following a model that allowed for multiple themes. So The theme that I have is stored in named "Base" under the App_Theme folder that is stored at the root of my project folder. It is really the one I want to use for all pages, so I thought I would reference it in the web.config file: <pages masterPageFile="~/Masters/SiteTemplate.master"
0
8685
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9171
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...
1
8905
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
8880
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7743
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
6532
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
4373
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4625
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.