当前位置:网站首页>大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>
边栏推荐
- Unity编辑器扩展C#遍历文件夹以及子目录下的所有图片
- ThreadLocal原理与使用
- C language printing exercise
- 使用SSH
- 2022CoCa: Contrastive Captioners are Image-Text Fountion Models
- Download the first Tencent technology open day course essence!
- 从实时应用角度谈通信总线仲裁机制和网络流控
- Li Kou brush question diary /day3/2022.6.25
- Guys, for help, I use MySQL CDC 2.2.1 (Flink 1.14.5) to write Kafka and set
- Mxnet implementation of googlenet (parallel connection network)
猜你喜欢

Angry bird design based on unity

每日一题(2022-07-02)——最低加油次数

Use canal and rocketmq to listen to MySQL binlog logs

Wanghongru research group of Institute of genomics, Chinese Academy of Agricultural Sciences is cordially invited to join

Scala basic tutorial -- 18 -- set (2)

Deleting nodes in binary search tree

Scala基础教程--20--Akka

Nebula Importer 数据导入实践
![[发布] 一个测试 WebService 和数据库连接的工具 - DBTest v1.0](/img/4e/4154fec22035725d6c7aecd3371b05.jpg)
[发布] 一个测试 WebService 和数据库连接的工具 - DBTest v1.0

Build your own website (15)
随机推荐
小发猫物联网平台搭建与应用模型
数组中的第K个最大元素
Unity给自己的脚本添加类似编辑器扩展的功能案例ContextMenu的使用
6.26CF模拟赛B:数组缩减题解
2022健康展,北京健博会,中国健康展,大健康展11月13日
2022养生展,健康展,北京大健康展,健康产业展11月举办
删除字符串中出现次数最少的字符【JS,Map排序,正则】
一种将Tree-LSTM的强化学习用于连接顺序选择的方法
In flinksql, in addition to data statistics, is the saved data itself a state
读写关闭的channel是啥后果?
Cache é JSON uses JSON adapters
2014 Hefei 31st youth informatics Olympic Games (primary school group) test questions
Li Chi's work and life summary in June 2022
Scala基础教程--19--Actor
Rookie post station management system based on C language
Scala basic tutorial -- 14 -- implicit conversion
[mathematical basis of machine learning] (I) linear algebra (Part 1 +)
C语言打印练习
Leetcode fizzbuzz C # answer
PB的扩展DLL开发(超级篇)(七)