Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Add a background image to a div

Reply
Thread Tools

Add a background image to a div

 
 
richard
Guest
Posts: n/a
 
      11-04-2007
On Sun, 04 Nov 2007 00:58:51 GMT, Adrienne Boswell wrote:

> Gazing into my crystal ball I observed Cristian <(E-Mail Removed)>
> writing in news:(E-Mail Removed) ps.com:
>
>> Hello!
>>
>> I have an image in a DIV#logo that is contained within a DIV.
>>
>><BODY>
>> <DIV ID="container">
>>
>> <DIV ID="logo">
>> <IMG SRC="url">
>> </DIV>
>>
>><-- other DIVs and content here -->
>>
>> </DIV>
>><BODY>
>>
>> I want to set an image background to the DIV#logo. This is the code I
>> am using:
>>
>> div#logo {
>> background: url(url.jpg) red;
>> }
>>
>> But the background image won't show up. I can see the red background
>> color. I've taken the image in the HTML away, I've added padding to
>> DIV#logo to see if the background image appears, but nothing happens.
>>
>> I hope someone can help me.
>>
>> Thanks in advance!
>>
>>

>
> Is url.jpg a real image? A URL would be helpful.


Why? Can't you supply your own image and a bit of similar coding locally?
Now I'll just bet that you were at this stage once and had the similar
problems right? Or did you become an expert without reading the manual?
 
Reply With Quote
 
 
 
 
richard
Guest
Posts: n/a
 
      11-04-2007
On Sun, 04 Nov 2007 00:08:59 -0000, Cristian wrote:

> Hello!
>
> I have an image in a DIV#logo that is contained within a DIV.
>
> <BODY>
> <DIV ID="container">
>
> <DIV ID="logo">
> <IMG SRC="url">
> </DIV>
>
> <-- other DIVs and content here -->
>
> </DIV>
> <BODY>
>
> I want to set an image background to the DIV#logo. This is the code I
> am using:
>
> div#logo {
> background: url(url.jpg) red;
> }
>
> But the background image won't show up. I can see the red background
> color. I've taken the image in the HTML away, I've added padding to
> DIV#logo to see if the background image appears, but nothing happens.
>
> I hope someone can help me.
>
> Thanks in advance!


http://www.w3schools.com/css/tryit.a...ckground-image

Something simple you failed to recall from the instructions.
We have all been there done that so don't worry about it.
 
Reply With Quote
 
 
 
 
Bone Ur
Guest
Posts: n/a
 
      11-04-2007
Well bust mah britches and call me cheeky, on Sun, 04 Nov 2007 03:09:32 GMT
richard scribed:

>> Is url.jpg a real image? A URL would be helpful.


> Why? Can't you supply your own image and a bit of similar coding locally?


I can't believe you said that but my new tolerance policy prevents me from
elaborating on idiotic statements.

> Now I'll just bet that you were at this stage once and had the similar
> problems right?


I was once a beginner but my worst problem was picking my nose and eating
it.

> Or did you become an expert without reading the manual?


Actually, yes, I did. Why, are you still struggling _with_ the manual?

--
Bone Ur
Cavemen have formidable pheromones.
 
Reply With Quote
 
rf
Guest
Posts: n/a
 
      11-04-2007

"Bone Ur" <(E-Mail Removed)> wrote in message
news:Xns99DDD5EB39D16boneurhyphe@85.214.62.108...
> Well bust mah britches and call me cheeky, on Sun, 04 Nov 2007 03:09:32
> GMT
> richard scribed:
>
>>> Is url.jpg a real image? A URL would be helpful.

>
>> Why? Can't you supply your own image and a bit of similar coding locally?

>
> I can't believe you said that but my new tolerance policy prevents me from
> elaborating on idiotic statements.


And, as has been proven, this would have achieved nothing at all. Adrienne
would have got it right, not knowing the information the OP did not provide.

<snip nit picking>

--
Richard.


 
Reply With Quote
 
Bone Ur
Guest
Posts: n/a
 
      11-04-2007
Well bust mah britches and call me cheeky, on Sun, 04 Nov 2007 05:52:55
GMT rf scribed:

>>>> Is url.jpg a real image? A URL would be helpful.

>>
>>> Why? Can't you supply your own image and a bit of similar coding
>>> locally?

>>
>> I can't believe you said that but my new tolerance policy prevents me
>> from elaborating on idiotic statements.

>
> And, as has been proven, this would have achieved nothing at all.
> Adrienne would have got it right, not knowing the information the OP
> did not provide.


Yep, without question. That's why a url is so important, but what got me
is that the replier implies people should respond using their own time and
resources to compensate for laziness or clueless behavior. Not this
wombat!

> <snip nit picking>
>


--
Bone Ur

When I was a young man I learned that having sex with a woman is fun until
you either get caught or married.
 
Reply With Quote
 
rf
Guest
Posts: n/a
 
      11-04-2007

"Bone Ur" <(E-Mail Removed)> wrote in message
news:Xns99DE17D2FB8CBboneurhyphe@85.214.62.108...
> Well bust mah britches and call me cheeky, on Sun, 04 Nov 2007 05:52:55
> GMT rf scribed:
>
>>>>> Is url.jpg a real image? A URL would be helpful.
>>>
>>>> Why? Can't you supply your own image and a bit of similar coding
>>>> locally?
>>>
>>> I can't believe you said that but my new tolerance policy prevents me
>>> from elaborating on idiotic statements.

>>
>> And, as has been proven, this would have achieved nothing at all.
>> Adrienne would have got it right, not knowing the information the OP
>> did not provide.

>
> Yep, without question. That's why a url is so important, but what got me
> is that the replier implies people should respond using their own time and
> resources to compensate for laziness or clueless behavior. Not this
> wombat!


Let me introduce you to the other "Richard". If it is whom I think it is
then you are in for some interesting times

--
Richard.


 
Reply With Quote
 
William Hughes
Guest
Posts: n/a
 
      11-04-2007
On Sat, 03 Nov 2007 23:01:37 -0400, in alt.html "Jonathan N. Little"
<(E-Mail Removed)> wrote:

>William Hughes wrote:
>
>> Instead of 'background-image', try just 'background':
>>
>> .marines {color: #660000; background: #acb78e
>> url(bg-marines.gif); border-color: #ff0033}
>>
>> translation: dark rust red, swamp green/digital camouflage, medium red

>
>'background' is just a shortcut for all the properties
>'background-color' + 'background-image' + 'background-position' ...


Exactly. My point was that it might be too specific.

>but that is not what his problem is here.


If you say so...
--
Support Project Valour-IT: http://soldiersangels.org/valour/index.html
 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      11-04-2007
William Hughes wrote:
> On Sat, 03 Nov 2007 23:01:37 -0400, in alt.html "Jonathan N. Little"
> <(E-Mail Removed)> wrote:
>
>> William Hughes wrote:
>>
>>> Instead of 'background-image', try just 'background':
>>>
>>> .marines {color: #660000; background: #acb78e
>>> url(bg-marines.gif); border-color: #ff0033}
>>>
>>> translation: dark rust red, swamp green/digital camouflage, medium red

>> 'background' is just a shortcut for all the properties
>> 'background-color' + 'background-image' + 'background-position' ...

>
> Exactly. My point was that it might be too specific.
>
>> but that is not what his problem is here.

>
> If you say so...


It wasn't. If you are specifying a background image and it doesn't
display just changing the property from 'background-image' to
'background' will *not* solve the problem. So, no your suggestion wan
not a possible solution for the OP.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
Bone Ur
Guest
Posts: n/a
 
      11-04-2007
Well bust mah britches and call me cheeky, on Sun, 04 Nov 2007 10:19:37
GMT rf scribed:

>> Yep, without question. That's why a url is so important, but what
>> got me is that the replier implies people should respond using their
>> own time and resources to compensate for laziness or clueless
>> behavior. Not this wombat!

>
> Let me introduce you to the other "Richard". If it is whom I think it
> is then you are in for some interesting times


Oh oh. Yes, I have had trouble with various "Richard"s in the past, but
fortunately, other even more irascible varmints have come along in a timely
manner to help redirect my sticky dickish conundrums. Just goes to show
ya, people as a whole are beneficial even when they might be acting like
clueless babes in the woods.

--
Bone Ur

When I was a young man I learned that having sex with a woman is fun until
you either get caught or married.
 
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
<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
NS/FF don't change div offsetWidth when div innerHTML is added toand div becomes wider mscir Javascript 3 06-26-2005 04:04 PM
Q: Div A inside Div B is larger than Div B Dwayne Madsen Javascript 1 06-01-2005 03:02 PM



Advertisments