当前位置:网站首页>大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>
边栏推荐
猜你喜欢
Scala基础教程--18--集合(二)
Summary and sorting of 8 pits of redis distributed lock
从实时应用角度谈通信总线仲裁机制和网络流控
Go微服务(二)——Protobuf详细入门
自由小兵儿
Principle and application of ThreadLocal
BI技巧丨权限轴
Rookie post station management system based on C language
Wireshark packet capturing TLS protocol bar displays version inconsistency
Nature microbiology | viral genomes in six deep-sea sediments that can infect Archaea asgardii
随机推荐
Scala basic tutorial -- 20 -- akka
从实时应用角度谈通信总线仲裁机制和网络流控
Go微服务(二)——Protobuf详细入门
2022健康展,北京健博会,中国健康展,大健康展11月13日
Build your own website (15)
爬虫(6) - 网页数据解析(2) | BeautifulSoup4在爬虫中的使用
C language printing exercise
876. 链表的中间结点
大佬们,求助一下,我用mysql cdc 2.2.1(flink 1.14.5)写入kafka,设置
SSL证书续费相关问题详解
Using FTP
基于unity的愤怒的小鸟设计
node_exporter部署
Cache é JSON uses JSON adapters
Wireshark网络抓包
Li Kou brush question diary /day1/2022.6.23
2021 Hefei informatics competition primary school group
6.26CF模拟赛B:数组缩减题解
使用SSH
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