What is the difference between src and href HTML attributes?

Answer

src (source) is used on elements that embed external resources directly into the page — the browser fetches and renders the resource inline. Examples: <img src="photo.jpg">, <script src="app.js">, <iframe src="page.html">. When the browser encounters a src, it pauses HTML parsing to fetch and process the resource. href (hypertext reference) creates a link to an external resource — the browser does not automatically embed the resource. Examples: <a href="page.html"> (navigation link), <link href="style.css" rel="stylesheet"> (CSS link). For the <link> element, the browser fetches the stylesheet but does not pause parsing.