|
Posted by dorayme on 11/19/01 11:56
In article <pan.2006.08.24.03.54.47.988897@XmbstevensX.com>,
mbstevens <NOXwebmasterX@XmbstevensX.com> wrote:
> On Thu, 24 Aug 2006 13:29:17 +1000, dorayme wrote:
>
> > Is there any trouble or downside in using a div for the sole
> > purpose of containing a background image, eg. a decorative
> > horizontal strip, not very high, 50px at most. If the height is
> > css'd at 50px and the pic is naturally 50px high, is it kosher to
> > leave out not only width, (a div being 100% by default), but also
> > repeat instructions. My tests work as I want.... but if there are
> > downsides, I would like to know about them.
>
> It might be a good idea to explicitly specify the z-index
> to make sure that it stays on the bottom.
> (Assuming you want it to be on the bottom.
> I suppose that with a transparent
> image you might want it somewhere in the middle of the deck.)
> Divs are great fun to use decoratively simply by assigning them a
> background color and a z-index. Some people oppose this kind of
> use (for instance, like the extra divs at zen garden), but I think it
> is perhaps a lesser misdemeanor than many.
> --
Well, basically, in my case, there is no top and bottom to worry
about... the pic is a made up one in a strip 50px high and about
450px wide and looks natural when repeated horizontally.
Originally I had a decorative strip on the page with the pic
placed in the HTML but, now, as a background, it goes as wide as
the browser window for little cost in bytes and looks quite nice
(just under a header and horizontal strip on the home page).
I am thinking now that purer would be to have the background on
the parent of this proposed div, a parent that has other
functions besides. Repeating for horiz only and setting top
margins on children to be gracefully clear of the background
image. But it would be more work and a touch awkward. I will
stick with this empty div unless anyone informs me of trouble I
could run into.
I suppose the idea of an empty div like this has questionable
semantic function but is it any more blight on accessibility than
an easily ignored background image in an obviously useful div
full of text content?
About transparency, it is not a big issue here, I have a jpg (the
strip is composed of little colour photos) with a background
matching the background of the parent of the div; in any case
very little is showing of this except tiny strips dividing the
pics. All in a line, no top, no bottom. Like this:
IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII except the black
bits are wider and nice enough little colour pics...
--
dorayme
Navigation:
[Reply to this message]
|