This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
Win a copy of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 this week in the Programmer Certification forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

direct reference to base64 data for background image

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
having trouble with syntax, presumingly this is possible

<html>
<head>
<style>
.bottle {
           width: 290px;
           height: 163px;
           background: url("properly formatted base64 string here" ) no-repeat;
       }
</style>

</head>
<body>

<h1> over eight billion tons of plastic have been produced since the 1950s </h1>


<div class="bottle"/>
would like to control location of this [ or any other ] base 64 image in background  with CSS



</body>
</html>
 
Sheriff
Posts: 24655
58
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The image you use is going to be on the network somewhere, quite possibly it comes from the same server as the CSS and the HTML. Although it could conceivably come from some other site. You need to provide the URL which points to that image, which you would do just the same as if you used an tag in the HTML.

I don't know what a "base 64 image" is. Normally you'd use a JPG or some other image type supported by your browser.
 
Marshal
Posts: 67300
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A base64 image is a protocol that allows the image data ( encoded as a base64 string) to be directly placed within the html as the image source rather than as a separate file.

I do not know if there is a way to use such an image as a background image.

If not, I’d use css to absolutely position the image behind anything that should overlay it.
 
Saloon Keeper
Posts: 10769
229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you mean embedding the image in the CSS?

https://css-tricks.com/data-uris/
 
Tomswell Robinson
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes indeed CSS Tricks ..... embedded base64 background !
just can't get syntax correct.
 
Saloon Keeper
Posts: 5878
147
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you have right now?
 
No holds barred. And no bars holed. Except this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!