The purpose is to use with some nice javascript by Patrick H. Lauke for
fading in images. The div is supposed to include a “loading image” image
which is overwritten by the final image when it has finished loading,
and this takes a moment as the image that finally appears is generated
thus:
Anyway, the loadimage div absolutely refuses to display an image so all
I see is an empty space in which the graph eventually appears. Even if I
use this div it in other locations, e.g. around text or a table, the
load.gif image will not appear. However, an img tag pointing to the
load.gif image will display it as normal.
Is this because I have made some error with the definition in the
stylesheet, or could there be some other problem?
if you have your stylesheet in a separate file, set the path to
your image relative to the css file.
Still no luck with that I’m afraid.
I also tried replacing the link to the image with a background colour
change and that doesn’t work either - it seems that the entire div is
ignored.
if you have your stylesheet in a separate file, set the path to
your image relative to the css file.
Still no luck with that I’m afraid.
I also tried replacing the link to the image with a background colour
change and that doesn’t work either - it seems that the entire div is
ignored.
Is it just been covered by the image? if you style the div so that it
is bigger than the image do the bits not covered by the image show the
background ?
ignored. However, the stylesheet must be being read as other parts of it
(e.g. table formatting) still work on the same view.
Most odd indeed.
Have to ask: have you validated both your markup and CSS? I often
find wierd problems like this being due to a simple typo on my part –
missing ending quote, or whatever; validation usually catches those.
if you style the div so that it
is bigger than the image do the bits not covered by the image show the
background ?
It appears not - re-sizing the div has no effect upon anything, even if
I make it an enormous size. It still appears as if the div is completely
ignored. However, the stylesheet must be being read as other parts of it
(e.g. table formatting) still work on the same view.
Most odd indeed.
Have to ask: have you validated both your markup and CSS?
Until I added this particular div definition, yes…
However, I tried again following your suggestion and it seems that it is
the div definition that is in error. Re-working it to look like this has
done the trick:
Try removing the image tag first, then seeing if it displays. My guess
is the image has a white background at first… which is causing the
background image to not show through.
Julian
Learn Ruby on Rails! CHECK OUT THE FREE VIDS (LIMITED TIME) NEW VIDEO
OUT 3rd APRIL http://sensei.zenunit.com/
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.