CSS方法:
.img {max-width:600px;width:600px;width:expression(document.body.clientWidth>600?"600px":"auto");overflow:hidden;}
JQuery方法:
$("img").each(function(){ if($(this).width() > $(this).parent().width()) { $(this).width("100%"); }});
Powered by: 博客园 Copyright © 2024 我从山中来 Powered by .NET 8.0 on Kubernetes