• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
CSS background images
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CSS background images


  • Subject: CSS background images
  • From: A <email@hidden>
  • Date: Wed, 13 Aug 2008 09:03:14 -0400

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

  • Follow-Ups:
    • Re: CSS background images
      • From: Houdah - ML Pierre Bernard <email@hidden>
    • Re: CSS background images
      • From: "Denis Frolov" <email@hidden>
  • Prev by Date: Re: strange WOFORM multiple submit behaviour
  • Next by Date: Re: CSS background images
  • Previous by thread: Re: Is D2W dead? [Was: WebAssistant IllegalStateException]
  • Next by thread: Re: CSS background images
  • Index(es):
    • Date
    • Thread