标签:style blog http java 使用 os io 问题
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>使用图片</title> <style type="text/css"> img{ width: 60%; height: 50%; } </style> </head> <body> <img src="http://anshun.wedsoso.com/uploadfile/1302/11301221423571361427837432.jpg" > </body> </html>
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>使用图片</title> <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script> <style type="text/css"> img{ width: 60%; height: 50%; } </style> </head> <body> <img src="http://anshun.wedsoso.com/uploadfile/1302/11301221423571361427837432.jpg" > <script type="text/javascript"> $("img").width(document.documentElement.clientWidth*0.6); $("img").height(document.documentElement.clientHeight*0.5); $(window).resize(function() { $("img").width(document.documentElement.clientWidth*0.6); $("img").height(document.documentElement.clientHeight*0.5); }); </script> </body> </html>
使用百分比设置自动缩放图片的小技巧,布布扣,bubuko.com
标签:style blog http java 使用 os io 问题
原文地址:http://www.cnblogs.com/Hfive/p/3892834.html