On the Applied Visual Design - Create Texture by Adding a Subtle Pattern as a Background Image page it asks to create a background with a URL. I’m entering it under the body selector (like it tells me too) as background: url(https://i.imgur.com/MJAkxbh.png); and it is not going through. What am I missing?
Hi there, you need to include the URL in quotation marks in order to work. For example: url(“link goes in here”);
Thanks, I missed this one too! Confusion set in because the pattern showed up in the window… made it look correct.
So, my question is, why the use of quotation marks if it works without them? Is it just for consistency?
Hi. I am not sure it works without the quotation marks. Does it really work?
Tried it out on Codepen.io and it works there without quotes:
URL background
Per the W3C, quotes are optional. However, the exception to this is the following:
Some characters appearing in an unquoted URI, such as parentheses, white space characters, single quotes (') and double quotes ("), must be escaped with a backslash so that the resulting URI value is a URI token: ‘(’, ‘)’.
I think for this exercise on freecodecamp, they want you to use quotes as a best practice.
Probably. I always use quotation marks though when it comes to URLs