I am learning HTML and CSS from W3schools. I came across a confusing instruction. HTML5 Style Guide of W3schools says "Only use quotes around values if the value contains spaces" in the Style sheets section. And it gave an example that looks like this:
body {
background-color: lightgrey;
font-family: "Arial Black", Helvetica, sans-serif;
font-size: 16em;
color: black;
}
Where the font-family property has a quoted value of Arial Black. But when I was doing the W3schools CSS background Exercise, the following code doesn't place the background image at the right top position
<head>
<style>
body {
background-image: url("img_tree.png");
background-position: "right top";
background-repeat: no-repeat;
}
</style>
</head>
After I removed the quotes around "right top", the background image was placed at the right top position. After some research, I read from this post that CSS properties generally cannot be quoted.
Now I am confused. From the W3schools style guide, it seems that it is a recommended standard to quote CSS properties with spaces. But then it doesn't work! When must I quote and when should I quote (in terms of the recommended standard)?