CSS Background Image in <div>

CSS Background Image in <div>

Post by don Carlo » Sat, 08 Jan 2005 08:37:04


Hey experts and other interested parties. Can I put a repeating background
image into a <div>? The purpose is to not have the image repeat behind the
banner logo, but to start immediately thereafter.[ Here's the placeholder
site. The logo will be in a #banner <div> and the main content in a #content
<div>L=Emmanuel Episcopal Church] http://www.yqcomputer.com/
 
 
 

CSS Background Image in <div>

Post by Michael Fe » Sat, 08 Jan 2005 09:01:14


.oO(don Carlos)


Sure.

Simply testing it would have been faster than writing a post and waiting
for an answer.

Micha

 
 
 

CSS Background Image in <div>

Post by don Carlo » Sat, 08 Jan 2005 09:37:37

well, actually I did test it and it failed, although ' *** ' tests usually do. Howsumever, Meyer's CSS tome says that background-image is restricted to the <body> tag.:frown;
 
 
 

CSS Background Image in <div>

Post by Michael Fe » Sat, 08 Jan 2005 09:47:15


.oO(don Carlos)


OK.


Hmm? You can apply a background image to nearly every element:

#content {
background-color: #RGB;
background-image: url(/path/to/image)
}

or with the shorthand property

#content {
background: #RGB url(/path/to/image)
}

where #RGB should be replaced with the value for a solid background
color which will be used in case the image can't be displayed.

Micha
 
 
 

CSS Background Image in <div>

Post by don Carlo » Sat, 08 Jan 2005 10:08:09

okay, I'll test it the right way (e.g carefully) and let you know tomorrow. Thanks
 
 
 

CSS Background Image in <div>

Post by Murray *TM » Sat, 08 Jan 2005 22:07:17

Where does it say that? I have those tomes and I can't find such a
statement.

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.yqcomputer.com/ - Template Triage!
http://www.yqcomputer.com/ , Tutorials & Resources
http://www.yqcomputer.com/ - DW FAQs, Tutorials & Resources
http://www.yqcomputer.com/ (MM) Technotes
==================
 
 
 

CSS Background Image in <div>

Post by don Carlo » Sat, 08 Jan 2005 23:04:02

Murray, et al. For the purposes of the question (and not to argue with the
advice given when asked), I refer to Cascading Style Sheets, the definitive
guide, 2nd edition, page 250 on Background Images. However, I believe what the
professionals tell me and am constructing a test page right now. If it works
(as I suspect it will), I'll send you the url. If not, I'll send you the url.
 
 
 

CSS Background Image in <div>

Post by don Carlo » Sat, 08 Jan 2005 23:55:50

I stand in awe! (well, sit actually). Here is the link to the placeholder page
with the background image firmly embedded in the <div id='content'> tag. On
the the CSS dropdown top nav bar. http://www.yqcomputer.com/ :D
 
 
 

CSS Background Image in <div>

Post by Murray *TM » Sun, 09 Jan 2005 00:06:01

If I could find my tome, I'd verify whether your interpretation is correct.
Since I can't right now, I'll have to just sit here and twiddle.

I do know that it works, however....

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.yqcomputer.com/ - Template Triage!
http://www.yqcomputer.com/ , Tutorials & Resources
http://www.yqcomputer.com/ - DW FAQs, Tutorials & Resources
http://www.yqcomputer.com/ (MM) Technotes
==================
 
 
 

CSS Background Image in <div>

Post by Murray *TM » Sun, 09 Jan 2005 00:25:19

I will quote from Cascading Style Sheets 2.0 - Programmer's Reference (by
the same esteemed author) -

"background-image defines a pointer to an image resource which is to be
placed in the background of an element."

Seems to imply any element on the page, no?

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.yqcomputer.com/ - Template Triage!
http://www.yqcomputer.com/ , Tutorials & Resources
http://www.yqcomputer.com/ - DW FAQs, Tutorials & Resources
http://www.yqcomputer.com/ (MM) Technotes
==================
 
 
 

CSS Background Image in <div>

Post by don Carlo » Sun, 09 Jan 2005 00:41:27

I don't have that particular tome, but I agree with your premise. Besides, I already admitted that your (and everyone else's) interpretation was correct. Stop beating me. I yield!
 
 
 

CSS Background Image in <div>

Post by Murray *TM » Sun, 09 Jan 2005 00:52:16

LOL! I'm not beating you. But I would like you to send your tribute money
now.

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.yqcomputer.com/ - Template Triage!
http://www.yqcomputer.com/ , Tutorials & Resources
http://www.yqcomputer.com/ - DW FAQs, Tutorials & Resources
http://www.yqcomputer.com/ (MM) Technotes
==================
 
 
 

CSS Background Image in <div>

Post by don Carlo » Sun, 09 Jan 2005 02:05:55

Not one pixel for tribute! But I will give you a problem worthy of your
greatness. The page-abuilding reacts strangely in Firefox. If you view the
css TopNav.css, you will see that I've had to put top padding in the Content
div. If I don't do that the first 3 words of text in the div slam to the right
margin. Yet it reacts correctly in IE 6. What am I doing
wrong? http://www.yqcomputer.com/ :o
 
 
 

CSS Background Image in <div>

Post by Murray *TM » Sun, 09 Jan 2005 04:13:45

Your CSS there is very strange. It appears that you are striking flys with
sledgehammers. Do you do that often? I'll need to study this....

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.yqcomputer.com/ - Template Triage!
http://www.yqcomputer.com/ , Tutorials & Resources
http://www.yqcomputer.com/ - DW FAQs, Tutorials & Resources
http://www.yqcomputer.com/ (MM) Technotes
==================
 
 
 

CSS Background Image in <div>

Post by don Carlo » Sun, 09 Jan 2005 06:54:52

I thought it was quite simple, since nothing is in the CSS except that which is
needed (save the fact that I haven't put the second and third level menu lists
in yet.) I await your analysis with baited breath (tuna for lunch). Karl