HTML picture Tag
HTML picture Tag
The picture tag gives web developers more flexibility in specifying image resources. The picture element contains two tags. One or more source tags and one img tag.
Working Principle:-
It basically works in a way such that first, it looks for the source element where the media query matches the viewport and after that, it will display the image. The use of img tag is necessary as it is used as a fallback in case the source element is not present. Its working principle is similar to video and audio elements.
Syntax:-
Its syntax is:- < picture >