473,413 Members | 1,807 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

How are images best set as <div> background?

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
4 8347
"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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Lilou | last post by:
Hello this page works : http://lilou.leuwen.chez.tiscali.fr/testlilou.htm the source : .... a.link:hover div.test2 {display : block; position: absolute; z-index: 1000;
9
by: Julia Briggs | last post by:
How do I construct a <iframe> or equivalent for FireFox/NS browsers, inside a screen centered <div> tag? Can it be done?
2
by: Nikolai Onken | last post by:
Hey, I am trying to learn the exact behavior of CSS and was just placing a couple of <div>'s after each other. Each of the <divhas a <pwithin and some text within the <p> Now when I add a...
3
by: rsteph | last post by:
I'm using two divs to create a shadowed-box type effect. Within the top div I want to put an image. I can get the image to center right to left, but not top to bottom. I'm making a series of boxes,...
2
by: Richard Maher | last post by:
Hi, I'm trying to use the Visibility Style attribute for a Div to effectively PopUp a lightweight window with some additional context-sensitive information, when a user mouses over a given...
5
by: Agix | last post by:
Hi there, Please check out : http://clarifysolutions.co.uk/certenroll/ The source is included below. This page is a test, so I can play about with paddings, margins and layouts using divs as...
5
nathj
by: nathj | last post by:
Hi All, I'm working on a new site that has a two column layout underneath a title bar. If you check out: http://www.christianleadership.org.uk/scratch/mainpage.php using IE or Opera you will...
4
by: harryusa | last post by:
I am trying to center 2 images concentrically which are z-indexed to lay on top of each other making an image with a border from another image that has a transparent center. I need the images to be...
8
prino
by: prino | last post by:
Hi all, I've written code (in REXX) that takes files in legacy languages (PL/I, COBOL, z/OS assembler, etc) and converts them into HTML in a format similar to what's displayed in the z/OS ISPF...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.