
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Set src to img Tag in HTML from Another Domain
To use an image on a webpage, use the <img> tag. The tag allows you to add image source, alt, width, height, etc. The src is to add the image URL. The alt is the alternate text attribute, which is text that is visible when the image fails to load. With HTML, add the image source as another domain URL. For that, add the src attribute as a link to another domain.
The following are the attributes:
Sr.No. |
Attribute & Description |
---|---|
1 |
alt |
2 |
height |
3 |
ismap |
4 |
longdesc |
5 |
src The URL of an image |
6 |
usemap |
7 |
width |
Just keep in mind the <img> tag has no end tag.
Example
You can try to run the following code to set src to the img tag in HTML from another domain
<!DOCTYPE html> <html> <head></head> <body> <h2>Qries</h2> <img src="https://www.qries.com/images/banner_logo.png" alt="Qries" width="200" height="90"> </body> </html>
Advertisements