skip to Main Content

Html – About 'media="(min-width: 0px)" '

About this code (I found a similar code on the Apple website): <picture> <source srcset="1.jpg, 1_2x.jpg 2x" media="(max-width: 734px)" /> <source srcset="2.jpg, 2_2x.jpg 2x" media="(max-width: 1068px)" /> <source srcset="0.jpg, 0_2x.jpg 2x" media="(min-width: 0px)" /> <img src="0.jpg" alt /> </picture> Question…

VIEW QUESTION

Html – media query js not apply when resizing width screen and click the link

So this is my code const mediaQ = window.matchMedia("(max-width:500px)") mediaQ.addEventListener("change", function(){ if(mediaQ.matches){ document.getElementById("box").style.backgroundColor = "blue" } else{ document.getElementById("box").style.backgroundColor = "red" } }) #box{ height: 20rem; width: 20rem; background-color: red; } <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width,…

VIEW QUESTION
Back To Top
Search