Basic question re. CSS quotes

Advert test

Eva

New Member
#1
hi guys, I'm a total beginner so for now this is going to be basic stuff......


In the syntax below, should myimage.jpg be in single quotes, in
double quotes or in no quotes?

Body {background-image:url(myimage.jpg);}

In W3Schools tutorials I'm seeing single quotes in the text, but in the Example it's double quotes.
An online search is throwing up samples with no quotes.


Also.....
Is there a definitive CSS Reference somewhere that lists not just CSS properties but also
their associated values?


Thanks for any assistance,
Eva
 

Eva

New Member
#2
Over two days has passed since I posted this, my first request, for help. Ninety (90!!) people have viewed my request but nobody has replied.

Can't help but wonder how many more newbies like me have had to join a different forum to find help. I regret having to leave because I would have preferred to be in an Irish forum.

Obviously this is not a good forum for a newbie to join.

Goodbye!
Eva.
 

mneylon

Administrator
Staff member
#3
Eva
Sorry, but this is a forum - people are free to help others - or not. There's no obligation on anyone to reply to a question and sometimes you'll get replies within minutes, other times it can take several days before someone comes along with a good answer.

As for your actual query...

Have you tried it with single, double and without quotes? What happens with each one?
Looking quickly at a few examples it doesn't seem to matter if you use double or single quotes https://developer.mozilla.org/en-US/docs/CSS/background-image
 
#4
I've always used single quotes but you could use double too and I believe no quotes will also work, just make sure your are linking to the right directory .. for example if your .css file is in .css folder and your image.jpg is in a folder named "images" then you would need :

background-image:url('../images/image.jpg');

web design essex
 
Top