Air Conditioner
Air Conditioner

Reputation: 123

Why can't the Google sites HTML box load a CSS script linked with URL?

I'm mostly certain that I set up my HTML script correctly, and made sure that the needed CSS file would be hosted in a shared folder on Google Drive, correctly cited, etc.

However, when I copy my HTML code into the box, and save it all, the editor always throes this error: 1+12 - 125: failed to load external url navigator.css

While I would think that linking the CSS file to the HTML code regularly, as I posted below, I only see so many issues coming up with CSS linking, and even more worrying, is that the Google support documentation (here) says that an HTML box can't 'refer' to external code, including what I believe may be such a CSS file.

<link href="http://[mixed aplhanumeric subdomain].googledrive.com/host/[shared folder's 'mixed' address]/navigator.css" rel="stylesheet" type="text/css">

Given that, would anyone know a simple workaround to linking the HTML to the CSS code in the Google sites HTML box?

Upvotes: 2

Views: 5145

Answers (2)

Hann
Hann

Reputation: 713

If you want to use Css on Google SItes , you can use directly. not to use link.

Upvotes: 0

Alan Wells
Alan Wells

Reputation: 31300

The documentation shows an example with the CSS in <script> tags. I don't perceive any indication that including CSS from an external file is allowed. The documentation explicitly states that <link> tags are not allowed. The reason why Google Sites can't load CSS in a linked file, is because link tags are not allowed. You're only choice is to include the CSS in <style> tags.

There is an alternative though. You can create an Apps Script HTML Service application with separate HTML and CSS files, and then put the Apps Script application into your Google Site.

Apps Script HTML Service

Upvotes: 2

Related Questions