0

Hello,
I am trying to make a .html document that has an image inside it.
I have seen this before, but I don't know how to do it.
The idea is here I don't want a index.html and image.png files, but I want just a index.html that
containd the content of image.png inside it.

Could someone help me?!

4
Contributors
5
Replies
28
Views
3 Years
Discussion Span
Last Post by JorgeM
0

So, aside from using <img /> elements within your HTML document, you could also "embed" an image via CSS using the background-image property assigned to an element on the page.

For example...

<!DOCTYPE html>
<html>
<head>
<title>Demo</title>
<style> 
body {
 background-image:url('images/grid.png')
}
</style>
</head>
<body>

</body>
</html>

[edit]
maybe i misunderstood now that I see paulkd's post. If you are interested in embedding pictures without having to reference a source picture, the link he provided covers that. If that is what you are looking for, there are quite a bit of sites online where you can upload a picture and the output will be a base64 string you can use in your HTML file within the <img /> element for the src attribute..

For example..

<img src="data:image/png;base64,iVBORw0K...." />
[/edit]

Edited by JorgeM

-1

<img src="filename"></img>
this is tag to embed the image in html

Votes + Comments
you missed the Q entirely, is not a how does the img anchor work, is how does multipart-mime work
0

Thank you for your help. The solution for my problem was:

<img width="320px" height="90px" src="data:image/gif;base64,iVBOsd........" />

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.