4 ms·
1. HTML is very forgiving. HTML also provides a comment mechanism <!-- --> between which anything will be ignored from a browser perspective. 2. JPEG also allo
by alanh 10y ago
1. HTML is very forgiving. HTML also provides a comment mechanism <!-- --> between which anything will be ignored from a browser perspective.
2. JPEG also allows for comments and other embedded metadata which won't show up in the displayed image.
3. Start the file with a JPEG header and metadata section, then switch between HTML and JPEG using the comment functionality mentioned above
Essentially!
"But wait, why is it shown as an image in one context and as a web page in another?"
The answer is in the question: Context. If you expect a JPEG you will get a JPEG, and same for HTML.