Re: CSS background images
Re: CSS background images
- Subject: Re: CSS background images
- From: Houdah - ML Pierre Bernard <email@hidden>
- Date: Tue, 19 Aug 2008 10:45:41 +0200
Try using my StyleSheetLinker (+ StyleSheetAction) to pre-process
image urls:
http://code.google.com/p/houdah-webobjects-frameworks/source/browse/trunk/HoudahAppServer/src/com/houdah/appserver/stylesheets/StyleSheetLinker.java
http://code.google.com/p/houdah-webobjects-frameworks/source/browse/trunk/HoudahAppServer/src/com/houdah/appserver/stylesheets/StyleSheetAction.java
Best,
Pierre Bernard
Houdah Software s.à r.l.
On 13 Aug 2008, at 15:03, A wrote:
Hey,
I've been designing a layout with static html/css that I'm now trying
to add dynamic elements to via webobjects. I added the stylesheet to
WebServerResources/styles and the images to WebServerResources/images.
In the stylesheet, I tried declarations like
background-image: url('../images/img_00.gif');
which should pull up the image for the directory structure I
specified.
It didn't work, so I tried a few other relative urls, a few absolute
urls, and never got the images to show.
I decided I would use the WOResourceURL component to get at the
images, so I created a WO component with declarations like:
background-image: url('<wo name="Img00"/>');
and the WOD file would say something like:
Img00 : WOResourceURL { filename = "WebServerResources/Images/
img_00.gif"; }
I felt a little dirty doing this, since I would really rather have the
stylesheet defined as a CSS file that the browser can easily cache
rather than a WO component which bloats the generated mark up of every
page in the app.
There is an even bigger problem however, that each page now loads very
slowly. It seems to me that all of the images are being reloaded on
every request, which is making it painful to develop.
So on to my questions:
What is the best way to reference a stylesheet with images?
If I use the approach I outlined, will the deployed app cache the CSS
component and images so that they don't slow down the app?
If so, is there something I can do in development to display the
images but force them not to reload on every request?
Thank you!
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden