html 图片超出部分左右滑动且不显示滚动条

手机上显示

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>

 

css样式
<style>
#testDiv{
display: flex;
width: auto;
overflow: auto;
max-height: 99px;
padding: 0 .5rem;
}
#testDiv img{
height: 100%;
width: 160px;
max-width: 160px;
max-height: 99px;
display: inline-block;
float: none;
}
</style>

html代码
<div id="testDiv">
<img src="1.png" alt="">
<img src="2.png" alt="">
<img src="3.png" alt="">
<img src="4.png" alt="">
<img src="5.png" alt="">
</div>

效果图

 

posted @ 2019-02-20 13:30  燃烧的腿毛  阅读(1297)  评论(0编辑  收藏  举报