摘要: 具体代码如下: <!html> <head> <meta charset="utf-8"> <title> css3 图片等比缩放,居中显示 </title> <style> .mysec{ width:400px; height:200px; border:solid 1px #ccc; back 阅读全文
posted @ 2020-03-13 10:22 ec04 阅读(370) 评论(0) 推荐(0) 编辑
摘要: img{ width: auto; height: auto; max-width: 100%; max-height: 100%; } 根据父容器的自动缩放,并保持图片原来的比例。这样你设置父容器的大小就可以啦。 阅读全文
posted @ 2020-03-13 09:58 ec04 阅读(678) 评论(0) 推荐(0) 编辑