I have index.html, style.css, image.png in one folder.
in index.html I include style.css
Newbie question
>
In style.css I set the background:
body{
background-image:url("image.png");
}
But the image doesn't load.
How should I correct the url in css?
Re: Newbie question
am 03.08.2007 09:01:43 von John
"Nikolay Kurtov" wrote in message
news:1186122493.857897.126340@o61g2000hsh.googlegroups.com.. .
>I have index.html, style.css, image.png in one folder.
>
> in index.html I include style.css
>
> Newbie question
>
>>
>
>
>
>
> In style.css I set the background:
>
> body{
> background-image:url("image.png");
> }
>
>
> But the image doesn't load.
> How should I correct the url in css?
>
Hi
Remove double primes around image.png
BODY { background-image:url(image.png);
Regards
John
Re: Newbie question
am 03.08.2007 09:05:10 von dorayme
In article
<1186122493.857897.126340@o61g2000hsh.googlegroups.com>,
Nikolay Kurtov wrote:
> I have index.html, style.css, image.png in one folder.
>
> in index.html I include style.css
>
> Newbie question
>
> >
>
>
>
>
> In style.css I set the background:
>
> body{
> background-image:url("image.png");
> }
>
>
> But the image doesn't load.
> How should I correct the url in css?
Perhaps you have made a spelling mistake or a space in the name,
case can be important including in the ".png"? Are you loading to
a free webhost? Try this on your local machine for your
index.html:
"http://www.w3.org/TR/html4/strict.dtd">
Newbie question
And see if you see red. Try a different image, one that
definitely opens when you drag the image file itself to the open
browser window.
--
dorayme
Re: Newbie question
am 03.08.2007 09:12:14 von dorayme
In article ,
"John" wrote:
>
> "Nikolay Kurtov" wrote in message
> news:1186122493.857897.126340@o61g2000hsh.googlegroups.com.. .
> >I have index.html, style.css, image.png in one folder.
> >
> > in index.html I include style.css
> >
> > Newbie question
> >
> >>
> >
> >
> >
> >
> > In style.css I set the background:
> >
> > body{
> > background-image:url("image.png");
> > }
> >
> >
> > But the image doesn't load.
> > How should I correct the url in css?
> >
>
> Hi
>
> Remove double primes around image.png
>
> BODY { background-image:url(image.png);
>
> Regards
> John
I can't see why would that work? Perhaps you know something?
"Nikolay Kurtov" wrote in message
news:1186122493.857897.126340@o61g2000hsh.googlegroups.com.. .
>I have index.html, style.css, image.png in one folder.
>
> in index.html I include style.css
>
> Newbie question
>
>>
>
>
>
>
> In style.css I set the background:
>
> body{
> background-image:url("image.png");
> }
>
>
> But the image doesn't load.
> How should I correct the url in css?
>
Have you included tags in your HTML?
+mrcakey
Re: Newbie question
am 03.08.2007 16:19:55 von rf
"mrcakey" wrote in message
news:f8uu10$lag$1@aioe.org...
> "Nikolay Kurtov" wrote in message
> news:1186122493.857897.126340@o61g2000hsh.googlegroups.com.. .
> Have you included tags in your HTML?
Body is an optional element in HTML.
In this case a URL is essential to solving the OP's problem.
--
Richard.
Re: Newbie question
am 03.08.2007 16:46:35 von mbstevens
Nikolay Kurtov wrote:
> I have index.html, style.css, image.png in one folder.
>
> in index.html I include style.css
>
> Newbie question
>
>
>
>
>
> In style.css I set the background:
>
> body{
> background-image:url("image.png");
> }
>
>
> But the image doesn't load.
> How should I correct the url in css?
>
In addition to the possibilities reflected in other answers, consider
whether you are posting from a Windows machine. Capitalization does not
matter there, but may on your server. For instance, IMAGE.PNG on a
windows machine would not load under a *[iu]x machine if you called it
"image.png".
Re: Newbie question
am 03.08.2007 16:53:22 von mrcakey
"rf" wrote in message
news:fQGsi.15622$4A1.14157@news-server.bigpond.net.au...
>
> "mrcakey" wrote in message
> news:f8uu10$lag$1@aioe.org...
>> "Nikolay Kurtov" wrote in message
>> news:1186122493.857897.126340@o61g2000hsh.googlegroups.com.. .
>
>> Have you included tags in your HTML?
>
> Body is an optional element in HTML.
>
> In this case a URL is essential to solving the OP's problem.
>
But the picture he/she's hoping to display is specified in the CSS as a
background to the body.
+mrcakey
Re: Newbie question
am 03.08.2007 19:12:23 von Michael Fesser
..oO(mrcakey)
>"rf" wrote
>>
>> Body is an optional element in HTML.
>>
>> In this case a URL is essential to solving the OP's problem.
>
>But the picture he/she's hoping to display is specified in the CSS as a
>background to the body.
The 'body' element is always there, even if it's not explicitly
mentioned in the HTML source code. Like 'tbody' for example.