您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

CSS实现图片等比例缩小不变形的实例分析

2024/6/27 22:42:01发布34次查看
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>css实现图片等比例缩小不变形</title> <link rel="stylesheet" type="text/css" href="../css/reset.css" /> </head> <style type="text/css"> .wrap { width: 90%; height: 550px; border: 1px solid #000; margin: 50px auto; } ul { width: 100%; height: 100%; } ul li { overflow: hidden; float: left; width: 350px; height: 350px; border: 1px solid #aaa; margin: 90px 0 0 43px; } ul li img { /*等宽缩小不变形*/ /*width: 100%;*/ /*二选一*/ /*等高缩小不变形*/ height: 100%; } </style> <body> <p class="wrap"> <ul> <li> <img src="../images/bg1.jpg" alt="" /> </li> <li> <img src="../images/bg2.jpg" alt="" /> </li> <li> <img src="../images/bg3.jpg" alt="" /> </li> </ul> </p> </body> </html>
以上就是css实现图片等比例缩小不变形的实例分析的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product