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

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -