Categories:
Cloud (204)
Entertainment (11)
Facebook (43)
General (50)
Life (31)
Programming (64)
Technology (398)
Testing (4)
Tools (488)
Twitter (5)
Wearable (26)
Web Design (44)
Collections:
Other Resources:
Use SVG Images in IMG Tags
How to Use SVG Images in HTML <img> Tags?
✍: FYIcenter.com
If you want to use SVG images in HTML <img> Tags, you can save SVG images in .svg files and include SVG image file names in the "src" attribute of <img> Tags.
You can follow this tutorial to test this.
1. Save the following SVG image in a file called, square.svg:
<svg xmlns="http://www.w3.org/2000/svg"> <rect x="1" y="1" width="100" height="100"/> </svg>
2. Save the following HTML document in another file called, square2.html:
<html><body> <p>Black <img src="/square.svg"/> Square... </p> </body></html>
When you open the above HTML file, square2.html, in a Web browser, you see a black square inserted inside a text line.
Similar to square.html in the previous tutorial, extra white spaces are padded below and after image. The the 100px x 100px square occupied an area of 300px x 150px.
See next tutorial on how to remove padded space around the SVG image.
⇒ Use IMG "width" and "height" to Crop SVG Images
⇐ Insert SVG Images in HTML Documents
2022-10-25, 307🔥, 0💬
Popular Posts:
How to download Mozilla Firefox 50.1? If you want to try Mozilla Firefox 50.1, you can follow this t...
Why am I getting the "You now have two copies of a file" error from OneDrive for Windows? You will g...
What is outlook.office365.com? Our IT tells us to migrate to outlook.office365.com. outlook.office36...
Where to find answers to frequently asked questions about Microsoft Office 365? Here is a collection...
How to save word documents into Unicode UTF-8 text files? When I convert Word documents into text fi...