html - 如何在使用 display:flex 换行文本后删除空格?
问题描述
我正在尝试并排制作两个文本块。我将 display:flex 与 flex-direction: flex-start 一起使用,但是,当我更改页面大小时,有时两个块之间会有很大的间隙。
案例1: 页面宽度较小时,没有空格:
案例2:在扩大页面宽度的同时,第二个块向右移动,两个块之间出现间隙
这是代码:
<!DOCTYPE html>
<html>
<head>
<style>
.a {
display: flex;
align-items: center;
justify-content: flex-start;
flex-flow: row;
align-content: flex-start;
}
.b {
border: 1px solid;
}
</style>
</head>
<body>
<div class="a">
<div class="b">This is some text. This is some texts a very loooooooooooooong text</div>
<div class="b">This is some text. This is some text. This is some text.</div>
</div>
</body>
</html>
解决方案
推荐阅读
- c++ - 如何在派生构造函数中初始化从基类继承的向量
- excel - 使用 While 循环获取特定列中的行句柄
- c# - 为什么这个 Base36 随机字符串不使用 RandomNumberGenerator 随机分布字符
- java - Jenkins - 带有动态 html 报告文件的电子邮件附件
- python - 如果有其他没有标签的盒子,如何抓取某些标签
- c# - 我的代码中有一个错误“找不到类型或命名空间名称‘spsite’”,我不知道如何解决它
- powerbi - 如何计算 Power BI 中选定属性的平均值
- c# - Spire Presentation (Spire.Pres) 在 Microsoft Azure 中启动错误
- ios - 当 UNNotificationExtensionUserInteractionEnabled 为真时,如何从 UNNotificationContentExtension 触发 didReceiveRemoteNotification
- javascript - 为什么 readonly false 属性不适用于文本框?