473,406 Members | 2,633 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,406 software developers and data experts.

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.jpg 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 1149
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
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...
1
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...
0
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 =...
1
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...
2
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?...
4
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...
0
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...
2
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...
1
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
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
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
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...
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...
0
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,...

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.