css控制图片不改变原比例居中显示,图片超出div部分隐藏
<!DOCTYPEhtml>
<html>
<head>
<matacharset="UTF-8"></mata>
<style>
#images{
display:flex;
flex-direction:row;
}
#image{
width:200px;
height:200px;
overflow:hidden;
display:flex;
justify-content:center;
align-items:center;
}
img{
width:auto;
height:200px;
}
</style>
</head>
<body>
<divid="images">
<divid="image">
<imgsrc="images/third.jpg">
</div>
<divid="image">
<imgsrc="images/third.jpg">
</div>
</div>
</body>
</html>
相关推荐
PioneerFan 2020-06-10
HSdiana 2020-03-28
e度空间 2020-04-30
FZfeng 2018-04-04
Ivy 2016-08-14
MrWhite0 2015-11-08
VincentDrW 2011-08-14
Dr凉 2015-06-10
asdjkl 2015-04-30
zhangpeng 2015-03-09
黎豆子 2014-12-03
yibawuqing 2019-06-27
KungLun 2014-09-29