Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Empty div for holding a background strip of pics...

Reply
Thread Tools

Empty div for holding a background strip of pics...

 
 
dorayme
Guest
Posts: n/a
 
      08-24-2006
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.

--
dorayme
 
Reply With Quote
 
 
 
 
mbstevens
Guest
Posts: n/a
 
      08-24-2006
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.
--
mbstevens
http://www.mbstevens.com/hume/index.html

 
Reply With Quote
 
 
 
 
dorayme
Guest
Posts: n/a
 
      08-24-2006
In article <(E-Mail Removed)> ,
mbstevens <(E-Mail Removed)> 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
 
Reply With Quote
 
mbstevens
Guest
Posts: n/a
 
      08-24-2006
On Thu, 24 Aug 2006 15:51:41 +1000, dorayme wrote:

> 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?


Not in my opinion. But the Xists might refuse to let you on the Saucer
if you persist in your wicked ways. You may be forced to buy an
indulgence.
;~)





 
Reply With Quote
 
dorayme
Guest
Posts: n/a
 
      08-24-2006
In article <(E-Mail Removed)> ,
mbstevens <(E-Mail Removed)> wrote:

> On Thu, 24 Aug 2006 15:51:41 +1000, dorayme wrote:
>
> > 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?

>
> Not in my opinion. But the Xists might refuse to let you on the Saucer
> if you persist in your wicked ways. You may be forced to buy an
> indulgence.
> ;~)


O ... I have long known my trip home is far from guaranteed... I
have indulged far too much in this earthly paradise for the
powers that be...

--
dorayme
 
Reply With Quote
 
Neredbojias
Guest
Posts: n/a
 
      08-24-2006
To further the education of mankind, dorayme
<(E-Mail Removed)> vouchsafed:

> 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.


Under some conditions, IE 6 has trouble with divs for which a width is not
specified.

--
Neredbojias
Infinity has its limits.
 
Reply With Quote
 
dorayme
Guest
Posts: n/a
 
      08-24-2006
In article <Xns9829188A3CF7Fhttpwwwneredbojiasco@208.49.80.25 1>,
Neredbojias <http://www.neredbojias.com/fliam.php?cat=alt.html>
wrote:

> To further the education of mankind, dorayme
> <(E-Mail Removed)> vouchsafed:
>
> > 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.

>
> Under some conditions, IE 6 has trouble with divs for which a width is not
> specified.


What about the specific condition of a div that has nothing at
all in it, is a child of the body that has no size specs and is
css'd to have a background image, be 50px high and margined left
1%. Shall I add width:100%?

--
dorayme
 
Reply With Quote
 
Neredbojias
Guest
Posts: n/a
 
      08-25-2006
To further the education of mankind, dorayme
<(E-Mail Removed)> vouchsafed:

>> > 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.

>>
>> Under some conditions, IE 6 has trouble with divs for which a width
>> is not specified.

>
> What about the specific condition of a div that has nothing at
> all in it, is a child of the body that has no size specs and is
> css'd to have a background image, be 50px high and margined left
> 1%. Shall I add width:100%?


If you did, it would cause a horizontal scrollbar (I think).

Most of the width problems I've run across occurred in IE 6 and a primary
div like you mentioned most likely wouldn't be a problem, anyway.

--
Neredbojias
Infinity has its limits.
 
Reply With Quote
 
dorayme
Guest
Posts: n/a
 
      08-25-2006
In article <Xns9829E3FF9BD96httpwwwneredbojiasco@208.49.80.25 1>,
Neredbojias <http://www.neredbojias.com/fliam.php?cat=alt.html>
wrote:

> > What about the specific condition of a div that has nothing at
> > all in it, is a child of the body that has no size specs and is
> > css'd to have a background image, be 50px high and margined left
> > 1%. Shall I add width:100%?

>
> If you did, it would cause a horizontal scrollbar (I think).


In that case I will leave it as is... , if I have time I will
consider my own suggestion a few posts back about not having a
special div for this... am working on a photo section of a
website now, after that I am done, and the client can have it and
pay me. It is for a charity (as it happens... and I agreed to
throw in 30 hrs free. Only my incompetence and distraction has
allowed this voluntary section to blow out to much more, it won't
count when I get to the Gates of St Peter's. But the 30 hours
should keep me away from the likes of you in your cell.... I saw
what happened to you in BdeZ's killfile! Where is she? I miss
her. One can grow fond of one's captors. It's a well known
phenemona, I think it even has a name, something bonding... I now
look back fondly on my days in her dungeons.

--
dorayme
 
Reply With Quote
 
Neredbojias
Guest
Posts: n/a
 
      08-27-2006
To further the education of mankind, dorayme
<(E-Mail Removed)> vouchsafed:

> In article <Xns9829E3FF9BD96httpwwwneredbojiasco@208.49.80.25 1>,
> Neredbojias <http://www.neredbojias.com/fliam.php?cat=alt.html>
> wrote:
>
>> > What about the specific condition of a div that has nothing at
>> > all in it, is a child of the body that has no size specs and is
>> > css'd to have a background image, be 50px high and margined left
>> > 1%. Shall I add width:100%?

>>
>> If you did, it would cause a horizontal scrollbar (I think).

>
> In that case I will leave it as is... , if I have time I will
> consider my own suggestion a few posts back about not having a
> special div for this... am working on a photo section of a
> website now, after that I am done, and the client can have it and
> pay me. It is for a charity (as it happens... and I agreed to
> throw in 30 hrs free. Only my incompetence and distraction has
> allowed this voluntary section to blow out to much more, it won't
> count when I get to the Gates of St Peter's. But the 30 hours
> should keep me away from the likes of you in your cell.... I saw
> what happened to you in BdeZ's killfile! Where is she? I miss
> her. One can grow fond of one's captors. It's a well known
> phenemona, I think it even has a name, something bonding... I now
> look back fondly on my days in her dungeons.


BdeZ had seemed to become nicer her last several posts that I saw. Maybe
she realized that her personal prejudices and dogmae weren't as sacrosanct
as she once assumed. However, it's hard to be sure. You know women...

--
Neredbojias
Infinity has its limits.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
strip all but second second line from bottom and then strip that!!!! yelipolok Perl Misc 4 01-27-2010 08:14 AM
<div ... /> and <div ...></div> K Viltersten ASP .Net 4 03-31-2009 07:33 PM
DIV background-repeat background-image? For shadow effect jc ASP .Net 3 03-19-2008 04:19 PM
DIV background-repeat background-image for shadowing effect jc HTML 1 03-19-2008 02:16 PM
strip and its evil brother strip! Aquila Ruby 35 03-31-2005 04:10 AM



Advertisments