当前位置:网站首页>大div中有多个div,这些div在同一行显示,溢出后产生滚动条而不换行
大div中有多个div,这些div在同一行显示,溢出后产生滚动条而不换行
2022-07-04 17:47:00 【回忆哆啦没有A梦】
之前有一个需求,大div中有多个div,这些div在同一行显示,正常情况下,要么会溢出撑满,要么换行。但是我们如何实现溢出后产生滚动条而不换行呢?
解决办法:
<style type="text/css">
.mt {
width: 600px;
height: 200px;
overflow: auto;
}
.mk {
white-space: nowrap;
}
.mj {
width: 150px;
height: 150px;
border: 1px solid #999;
display: inline-block;
}
</style>
</head>
<body>
<div class="mt">
<div class="mk">
<div class="mj"></div><div class="mj"></div><div class="mj"></div><div class="mj"></div><div class="mj"></div><div class="mj"></div><div class="mj"></div><div class="mj"></div><div class="mj"></div>
</div>
</div>
</body>
边栏推荐
- 2019年蜀山区第十五届青少年信息学竞赛
- ByteDance dev better technology salon was successfully held, and we joined hands with Huatai to share our experience in improving the efficiency of web research and development
- 性能优化之关键渲染路径
- Lex and yacc based lexical analyzer + parser
- 删除字符串中出现次数最少的字符【JS,Map排序,正则】
- 启牛开的证券账户安全吗?
- 2014 Hefei 31st youth informatics Olympic Games (primary school group) test questions
- [mathematical basis of machine learning] (I) linear algebra (Part 1 +)
- 2021 合肥市信息学竞赛小学组
- Unity editor extends C to traverse all pictures in folders and subdirectories
猜你喜欢
随机推荐
启牛开的证券账户安全吗?
Scala basic tutorial -- 20 -- akka
李迟2022年6月工作生活总结
使用canal配合rocketmq监听mysql的binlog日志
技术分享 | 接口测试价值与体系
Bi skills - permission axis
Deleting nodes in binary search tree
C#实现定义一套中间SQL可以跨库执行的SQL语句(案例详解)
Scala basic tutorial -- 14 -- implicit conversion
OpenCV的二值化处理函数threshold()详解
【机器学习的数学基础】(一)线性代数(Linear Algebra)(上+)
Caché WebSocket
Using FTP
千万不要只学 Oracle、MySQL!
How is the entered query SQL statement executed?
2014 Hefei 31st youth informatics Olympic Games (primary school group) test questions
正则替换【JS,正则表达式】
TorchDrug教程
完善的js事件委托
26. Delete the duplicate item C solution in the ordered array








