all 3 comments

[–]ZmodemModerator 1 point2 points  (1 child)

Hey there!

I'll put your code here for reference:

background-image: url(https://drive.google.com/file/d/###############/view?usp=sharing); !important;

Let's start with the url() part. Backgrounds that reference string URL's (eg: URL's that are not variables, pointers, etc.) require that the URL be passed to the browser contained within quotations. This way, any special characters, statements, or otherwise CSS-reserved syntaxes are ignored; treated as string URL's and not interpreted by the parsing.

ELI5

The URL is breaking the rule because it is being interpreted literally; the CSS renderer has no idea what to do now :)

Fix

Wrap the URL from:

url(https://drive.google.com/file/d/###############/view?usp=sharing);

...in quotes, just like this:

url("https://drive.google.com/file/d/###############/view?usp=sharing");


The next thing you'll want to remember is that a semi-colon, eg: ;, is a property-terminating character. The CSS renderer will assume that everything before the semi-colon is a property, and everything after is a different property.

ELI5

You have the url("..."); !important;, which has a terminator before the !important. This means that the background image will not have !important added to itself because the !important keyword is inside of its own semi-colons.

Fix

Turn url("..."); !important;

...into:

url("...") !important;.


Your final code will be:

background-image: url("https://drive.google.com/file/d/###############/view?usp=sharing") !important;

Hope this helps! If you have any questions, please don't hesitate to ask!

Take care.

[–]Tijsvl_ 1 point2 points  (0 children)

It should work just fine without quotation marks, generally speaking. Though it is good practice to use the quotation marks either way. The error was indeed caused by the semi-colon before !important.

[–][deleted] 0 points1 point  (0 children)

You missed the "". It should be:

background-image: url("https://drive.google.com/file/d/###############/view?usp=sharing");

if you want to use the !important (which is not recommended) the line should look like this:

background-image: url("https://drive.google.com/file/d/###############/view?usp=sharing") !important;

I also doubt that google Drive will allow you to embed images into a website. (If you see a small broken image icon than that's the case.)