Powered by Blogger.

How to Host CSS or JavaScript Files in Blogger using Google Drive

 


Blogger doesn’t provide the flexibility to the user to host or upload CSS, video or JavaScript files in google blogger. You can able to put full or complete coding through HTML Tags.

For example if you want to give external link for css then it is not possible only you can able to write whole css code between <style> tag.

If you really want to provide external link for css and javascript then you have to use third-party apps that will help you to host or upload files in blogger including Google Apps, Google Code, and Google App bot. Google Drive is better for uploading and hosting files.



How to Host CSS Files with Google Drive in Blogger:

Step#1: Making a folder on Google Drive:

You need to upload style.css or javascript file to your Google Drive account. First go to Google Drive and login it.Now you can able to create a new folder and you can upload all the files at one place. Press the “Create” button from top left corner and from the drop down list select “Folder”. Give name the folder to anything that you want.  






Step#2: Uploading your style.css file on Google Drive:

Then after open the folders that you have created. Click the upload icon that present on the left side of your screen, then a drop down list will appear which would provide you two choices i.e. File and Folder. Just select “File” that you need to upload.





Next step is that you select the file that is style.css and js file and then click on that open button.

Step#3: Sharing your style.css file link

Then you just right click on file and you will get share option and click on it. And then change setting Who has access from private to public and save it.


After that will get the sharing link. Copy that link.


After Copying that sharing Link from google drive, it would looks like that https://docs.google.com/file/d/your-file-code/. You have to change the copied link to https://googledrive.com/host/your-file-code.


Make sure that /file/d/ is also replaced with /host/ so then it will works.

Step#4: Adding Google Drive Hosted CSS file in Blogger 

Now you can able to add this link https://googledrive.com/host/your-file-code. in your <link> to call external css or javascript file from outside of blogger that are present on google drive.

<link href='https://googledrive.com/host/your-file-code' rel='stylesheet'/>

No comments