CSS: background image

R

R.A.M.

Hello,

Could you help me please with a simple problem?
I want to have background image on some pages of a website I am
creating. I added a ass to Styles.css:
.withbackground
{
background-image: "Images/DotNET_90x70_light.jpeg"
}
which I use on these pages
<link rel="Stylesheet" type="text/css" href="Styles.css" />
<head>
<body class="withbackground">
Could you explain me please why it doesn't work and how to do it
correctly?
Thank you very much!

/RAM
 
D

David Dorward

R.A.M. said:
background-image: "Images/DotNET_90x70_light.jpeg"
Could you explain me please why it doesn't work and how to do it
correctly?

http://www.w3.org/TR/CSS2/colors.html#background-properties

'background-image'
Value: <uri> | none | inherit

And following the link to see where "<uri>" is described:

http://www.w3.org/TR/CSS2/syndata.html#value-def-uri

URI values in this specification are denoted by <uri>. The functional
notation used to designate URIs in property values is "url()", as in:

BODY { background: url("http://www.bg.com/pinkish.gif") }
 
B

Barbara de Zoete

I want to have background image on some pages of a website I am
creating. I added a ass to Styles.css:
.withbackground
{
background-image: "Images/DotNET_90x70_light.jpeg"
}
Could you explain me please why it doesn't work and how to do it
correctly?

When something doesn't work as you expected it to, validate:
<URL:http://jigsaw.w3.org/css-validator/... }&warning=0&profile=css21&usermedium=screen>

Then look up how you should have done it properly:
<URL:http://www.w3.org/TR/REC-CSS2/colors.html#propdef-background-image>
 
N

Neredbojias

With neither quill nor qualm, R.A.M. quothed:
Hello,

Could you help me please with a simple problem?
I want to have background image on some pages of a website I am
creating. I added a ass to Styles.css:
.withbackground
{
background-image: "Images/DotNET_90x70_light.jpeg"
}
which I use on these pages
<link rel="Stylesheet" type="text/css" href="Styles.css" />
<head>
<body class="withbackground">
Could you explain me please why it doesn't work and how to do it
correctly?
Thank you very much!

The correct line is:

background-image:url(Images/DotNET_90x70_light.jpeg);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top