image - HTML5 picture and source element -
i have written these lines in html file in order change picture if orientation changed.
<picture> <source media="all , (orientation: landscape)" srcset="images/images/images_of_teaching/futas_running_720w.jpg 720w, images/images/images_of_teaching/futas_running_1080w.jpg 1080w"> <source media="all , (orientation: portrait)" srcset="images/images/images_of_teaching/iras_writing_720w.jpg 720w, images/images/images_of_teaching/iras_writing_1080w.jpg 1080w"> </picture>
but not work. me out please?
thank you
ensure specify img tag inside of picture tag:
<picture> <source media="all , (orientation: landscape)" srcset="your image"> <source media="all , (orientation: portrait)" srcset="your-other image"> <img src="your-main-image.extension" alt= "your image quick description"/> </picture>
Comments
Post a Comment