当前位置:网站首页>大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 basic tutorial -- 17 -- Collection
- 26. Delete the duplicate item C solution in the ordered array
- Unity给自己的脚本添加类似编辑器扩展的功能案例ContextMenu的使用
- The latest progress of Intel Integrated Optoelectronics Research promotes the progress of CO packaging optics and optical interconnection technology
- Angry bird design based on unity
- .NET ORM框架HiSql实战-第二章-使用Hisql实现菜单管理(增删改查)
- 1672. Total assets of the richest customers
- Scala基础教程--14--隐式转换
- Go微服务(二)——Protobuf详细入门
- C language printing exercise
猜你喜欢
随机推荐
IBM WebSphere MQ检索邮件
LeetCode FizzBuzz C#解答
Go微服务(二)——Protobuf详细入门
性能优化之关键渲染路径
How is the entered query SQL statement executed?
26. 删除有序数组中的重复项 C#解答
Using SSH
PB的扩展DLL开发(超级篇)(七)
DeFi生态NFT流动性挖矿系统开发搭建
整理混乱的头文件,我用include what you use
Scala基础教程--17--集合
Detailed explanation of issues related to SSL certificate renewal
利用策略模式优化if代码【策略模式】
2022-07-04: what is the output of the following go language code? A:true; B:false; C: Compilation error. package main import 'fmt' func
Scala基础教程--15--递归
完善的js事件委托
Nature microbiology | viral genomes in six deep-sea sediments that can infect Archaea asgardii
Caché WebSocket
使用SSH
Installation and use of VMware Tools and open VM tools: solve the problems of incomplete screen and unable to transfer files of virtual machines