Src element


the <img> element contains attribute “src” whose value is the url of image .
But when we add <a> attribute to convert img element into a link the URL is writtern with href element before src .why? Can we write the url with src and the name of image with href element?!


because the href attribute belongs to the anchor element (<a></a>) where as the src attribute belongs to the image, given the image needs to be clickable, the image element inside nested inside the anchor element


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.