- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Should I use
,
To add SVG files, you can use <img> <object>, or <embed> element in HTML. Choose any one of them according to your requirement. Here’s how you can add SVG,
<img> element
Use the <img> tag for images without interaction.
The disadvantage is you cannot manipulate images with JavaScript.
<img src = "new.svg" alt = "craft" height = "100px" width = "100px" />
<object> element
The <object> element is used to define an embedded object within an HTML document. Use it to embed multimedia like audio, video, flash, etc in the web page.
<object type = "image/svg+xml" data = "new.svg"> Your browser does not support SVG </object>
<embed> element
The <embed> tag wasn’t part of the HTML 4 specification and is new in HTML5. It validates in an HTML5 page.
<embed type = "image/svg+xml" src = "image.svg" />
- Related Articles
- How to use .svg files in a webpage?
- Should I use PyCharm for Programming in Python?
- Should I use MySQL enum or tinyint for fields having values 1 and 0?
- HTML DOM embed object
- Which datatype should I use for flag in MySQL?
- Why should I use Hubspot?
- When Should I use Selenium Grid?
- Which one should I use? The datetime or timestamp data type in MySQL?
- Should I learn MATLAB or Python?
- When should I use MySQL compressed protocol?
- How should I pass a matplotlib object through a function; as Axis, Axes or Figure?
- FabricJS – Determining Whether fill or Stroke Should be Drawn First for a Polygon Object?
- Which datatype is should I use to set a column for 5-star rating?
- How do I embed JavaScript expressions into JSX?
- How to use SVG images in HTML5?

Advertisements