Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Including images directly in HTML files

 
Ruediger Waurig
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
I've got the following question:
Usually placing an image in a HTML file is done by
<img SRC="myPicture.jpg">
or
<OBJECT type="image/jpg" data="myPicture.jpg">
</OBJECT>
But this means that there is an external file that contains the image, in this case myPicture.jpg
I don't want to have an additional external file that is referenced from within the HTML file. How can I manage to have the image be included directly in the HTML file itself?
I.e. when sending an e-mail in html format then the pictures are included in the same html file.
Ruediger
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65118
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No can do. HTML just doesn't do that.
E-mail messages that seem to "embed" images in HTML actually do no such thing. Rather, they are multi-part messages where the HTML is included in one part, and any "embedded" images are stored in other parts. The mail client peices it all together for display.
hth,
bear
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
XML includes the ability to embed binary data, so in theory it may be possible in XHTML, but I really doubt that anyone has bothered to implement anything like this in the clients.
Like Bear says, HTML just doesn't do that.
Dave
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic