用window.innerWidth来测试当前的逻辑分辨率 <!DOCTYPE html> <html> <body> [removed] var p=document.getElementById('1'); p.innerText=window.innerWidth; p.innerText+=" "+window.innerHeight; [removed] </body> </html>