码迷,mamicode.com
首页 > Web开发 > 详细

网页内联图片 html inline image

时间:2015-01-03 19:53:50      阅读:4252      评论:0      收藏:0      [点我收藏+]

标签:

网页内联图片 html inline image

不是像这样,
<img src="http://www.nenu.edu.cn/xiaohui.png">

上述代码中,图片是独立于HTML而存在于另一个URL的。

内联是像下面这样,图片是HTML的一部分,这样适合用代码生成,或者javascript改写。
把下面的代码保存为 html 文档,用浏览器打开,可见效果。

技术分享


参考:


[http://stackoverflow.com/questions/1207190/embedding-base64-images]

[http://www.bigfastblog.com/embed-base64-encoded-images-inline-in-html]

[http://base64image.org/]


-----代码开始-------------

<img alt="Embedded Image" src="data:image/png;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCABUAG8DASIAAhEBAxEB/8QAHAABAAIDAQEBAAAAAAAAAAAAAAYHAwQFCAEC/8QANRAAAgEEAAQFAgUEAAcAAAAAAQIDAAQFEQYSITETIkFRYRQyBxVCcYEjUmKRJFNygpKxsv/EABgBAQEBAQEAAAAAAAAAAAAAAAADAgEE/8QAJBEAAgIBAwQCAwAAAAAAAAAAAAECESEDEkEEEzFRFCJhcbH/2gAMAwEAAhEDEQA/APVNKUoBSlfGYIpZiAoGyT6UB9pUTyHGUG5I8LbtkHQbabm5IE+TIe4+QNfNcLIZ/KC7toMjmILH6qMyxx2UHic0eiQwc7HprofUe9UWnJmHNIsmlU5bZhbh8ZDLk8+8t7I6EC7CNERyHsCQ3lcN09N+1YrTiOC4xU1/bZnOwpbLAWQziZmklLDkGzry8pJ9NVvsMz3UXRSoLb5DiKBLye3u7TJWtrNJDL9QngEFNb0w0NfOj611sXxbZ3M62uQikx14xAEc/w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xtdvvzkKG5pCx3shgB33rpoaFeaT3tyKr6pI07HK5LC8UDG3VuwwxDJHJy83JyrzGRn115tknp0J710eFlkyuavczMpWJd29uD+45z/HKq/urVr3N1c8W3ZtMcZIMVE+p7odCxH6V/wAv/nueuhUvs7aGztYra2jWKCJQiIvZQOwpJ0vydir/AEZaUpUjYpSlAK1sjYWuRtWt72FJoW68rDsfQg9wR7jrWzSngER/Js1hGLYO7W8tQd/S3R0w/Zux/nR9ya5vEGYS+sUgz+OyuOeOQSI8RYKZADrbr6AnferApW1PNtGdvohPCOb4cw2DtMZBlUkMKeZmB2zE7Y9vcnpXM/EDMYfO4+CytcnEsizczEFgVAU60NeY710/n0qwpLO2kbmkt4Xb3ZATX2G1t4TuGGKM+6oB/wCq0ppS3cnNrqiIY/iTKXFjDFj8XcX03L1uWi8CI9f8j6dPXrWeHhq+ykom4kvAyb5haWpKp/3N0J/gD5JqXUrO/wBKju32Y7eCK2gSG3jSKJByqiKFVR7ACslKVg0KUpQClKUApSlAKUpQClKUApSlAKUpQClKUB//2Q==" />

-----代码开始-------------

------------------------------------------------------------

博客会手工同步到以下地址:

[http://giftdotyoung.blogspot.com]

[http://blog.csdn.net/younggift]

网页内联图片 html inline image

标签:

原文地址:http://blog.csdn.net/younggift/article/details/42365707

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!