PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, May 10, 2022

[FIXED] How to use google drive image inside css background-image: url() function?

 May 10, 2022     css, google-drive-api, html, image, url     No comments   

Issue

I have an image on google drive and I would like to use that inside my html code. Image on Google Drive I give this url inside css background-image: url() but which is not loading the image.How can i fix this?.I'm added my snippet below.

#image-container{
  width:300px;
  height:300px;
  border:1px solid #000;
  background-image:url(https://drive.google.com/file/d/1BXGs4wvPdiz1JHoEuSkMMLbjaRN0od5a/view);
  background-repeat:no-repeat;
  background-size:100% 100%;
  }
<div id="image-container"></div>


Solution

If you want to use file ID, how about this?

http://drive.google.com/uc?export=view&id=1BXGs4wvPdiz1JHoEuSkMMLbjaRN0od5a

Note :

  • If the image is not shared, the link gets to be not able to be used.


Answered By - Tanaike
Answer Checked By - Robin (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing