InterviewSolution
Saved Bookmarks
| 1. |
How to insert a image in a web page |
Answer» Let’s pretend we have an image of a dog on our computer saved as “funny-dog.jpg” and we want to insert it into a webpage; this is the code we would use:\t1<img\xa0src="funny-dog.jpg">\tLet’s analyze this code. First,\xa01<img\xa0src="images/funny-dog.jpg">\tSelf Closing ElementsAs you can see, in both code examples so far there has\xa0not\xa0been an ending\xa0\xa0tag, because the image code is a “self closing” element. This is because unlike a paragraph, we won’t have a plethora of content inside our 1<img\xa0src="funny-dog.jpg"\xa0alt="A funny dog sitting on the grass.">\t
|
|