By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,294 Members | 2,687 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,294 IT Pros & Developers. It's quick & easy.

How are images best set as <div> background?

P: n/a
Just looking for the best way to set an image to fill a <divcontainer as a
background without upsetting HTML/CSS validation...

Thanks in Advance...

--
Timothy Casey GPEMC! >11950 is the nu****@fieldcraft.biz 2email
Terms & conditions apply. See www.fieldcraft.biz/GPEMC
Discover valid interoperable web menus, IE security, TSR Control,
& the most advanced speed reading application @ www.fieldcraft.biz
Aug 27 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
"Number 11950 - GPEMC! Replace number with 11950"
<nu****@fieldcraft.bizwrote:
>How are images best set as <divbackground?
Note that the widespread practice of coding images as CSS background
images is mostly misguided. If like many you have been "inspired" by CSS
ZenGarden, note that their coding practices result from a fundamental
flaw in their methodology, the resulting coding should not be emulated.

Coding images as CSS background images thwarts two types of essential
and/or basic functionality:

1) Non decorative images should be substituted by appropriate alt
content if a UA does not process images.

2) For decorative images the screen space occupied by images should be
freed up if a user has images disabled and CSS enabled.

--
Spartanicus
Aug 27 '06 #2

P: n/a
On Sun, 27 Aug 2006 12:12:20 +1000, "Number 11950 - GPEMC! Replace
number with 11950" <nu****@fieldcraft.bizwrote:
>Just looking for the best way to set an image to fill a <divcontainer as a
background without upsetting HTML/CSS validation...
Take note of what Spartanicus says. Assuming it's really a background,
then use CSS, e.g:

#mydiv {background: url(paper.jpg) #FFF8E8; color:black; }

where the background colour specification is an appropriate colour to
use if the image is not loaded.

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Aug 27 '06 #3

P: n/a
Number 11950 - GPEMC! Replace number with 11950 wrote:
Just looking for the best way to set an image to fill a <divcontainer as a
background without upsetting HTML/CSS validation...

Thanks in Advance...
Just be sure that the background does not interfere with reading text.
In general, background images should be similar to a watermark created
by Word: transparent and light.

--

David E. Ross
<http://www.rossde.com/>

Concerned about someone (e.g., Pres. Bush) snooping
into your E-mail? Use PGP.
See my <http://www.rossde.com/PGP/>
Aug 27 '06 #4

P: n/a
Sym

Spartanicus wrote:
Note that the widespread practice of coding images as CSS background
images is mostly misguided. If like many you have been "inspired" by CSS
ZenGarden, note that their coding practices result from a fundamental
flaw in their methodology, the resulting coding should not be emulated.
Out of interest, what is the fundamental flaw in their methodology ?
rgds
Symeon.

Sep 1 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.