我在html中編寫代碼,我需要設置根據設備更改iframe大小的代碼。如何根據設備更改iframe中的參數?
這裏我的代碼:
<!DOCTYPE html>
<html>
<body>
<iframe width="100%" height="200" src="https://www.youtube.com/embed/uRMz4pA0_4M?ecver=1" frameborder="0" allowfullscreen></iframe>
</body>
</html>
「
我想要像這樣:if mobile iframe ... if if desktop iframe ... –
如果設備是移動設備或臺式機,應該做什麼改變? '