+ 9

Whats the difference between href and src in HTML?

link - href img - src base - href srcipt - src source - src

9th Apr 2017, 2:12 PM
Siddharth Saraf
9 Answers
+ 12
I think by using href we may provide a link to other URL but src is more specified about the think like some library or any file etc.,on the web or the computer
9th Apr 2017, 2:49 PM
Nikhil - avatar
+ 15
@Hamja : src can also be used to link to libraries and frameworks
15th Apr 2017, 3:12 PM
Nikhil - avatar
+ 7
@Decodes srcipt src = https://www.jquery.com/3.1.1.js How? It is an online file and link href = w3.css in Computer Please ignore the given link. Its just for illustration
9th Apr 2017, 2:29 PM
Siddharth Saraf
+ 1
href is used to link another web site ,while src is used to look for a particular thing like image or file in a computer file
9th Apr 2017, 2:23 PM
Decodeworms Olamilekan
Decodeworms Olamilekan - avatar
+ 1
src SHOWS something from anywhere (images from your desktop, videos from YouTube, etc.) <img src="images/photo.jpg" alt="photo"> <iframe src="http://www.youtube.com/embed/kkytzD30nJ8"> href provides a link to other website or element <... href="http://www.github.com"> <... href="css/styles.css">
16th Jun 2017, 3:50 PM
Franco Del Castillo
Franco Del Castillo - avatar
+ 1
src is used for providing the source location from where the file or image can be linked in our HTML page
19th Jul 2017, 7:01 AM
anita dala
anita dala - avatar
src...for image href...for web site
15th Apr 2017, 2:52 PM
Maachou Hamza
Maachou Hamza - avatar
href (hyper reference) is a URL link address of any website like href=" http://www.google.com" while src (source) is a location which locate file (images) like src=" Images/picture/cat image.jpg( or png) "
25th Apr 2017, 6:27 PM
CYPH3R - avatar
- 1
sorry ,src is used to link to a particular file in a computer folder
9th Apr 2017, 2:24 PM
Decodeworms Olamilekan
Decodeworms Olamilekan - avatar