首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何影响折叠<span>线的启动?

如何影响折叠<span>线的启动?
EN

Stack Overflow用户
提问于 2018-10-03 10:38:39
回答 1查看 145关注 0票数 0

我有一个由三个<span>组成的文本,我不理解折叠它们时使用的规则:

代码语言:javascript
复制
<span style="font-family: sans-serif; 
font-weight: normal; 
color: black; 
background-color: white; 
border-color: darkblue; 
border-style: solid; 
border-width: 5px; 
padding: 3px 3px 3px 7px;
text-align: center;
">
    ℹ
</span>
<span style="
font-family: sans-serif; 
font-weight: bold;
color: white; 
background-color: darkblue;
border-color: darkblue;
border-style: solid;
border-width: 5px;
padding: 3px 3px 3px 3px;
">
    This is some text
</span>
<span style="font-family: sans-serif; 
font-weight: normal; 
color: black; 
background-color: white; 
border-color: darkblue; 
border-style: solid; 
border-width: 5px; 
padding: 3px 5px 3px 5px;
">
    This is more text, a longer one which will eventually fold. Some more words.
</span>

如果缩小了浏览器的宽度,则消息会折叠并重叠上面的部分。

是如何计算折叠的?(决定将文本放置在特定距离时考虑了什么?)

因此:,影响下一行文本底部移动的参数是什么?(换句话说:更改什么,以便第二行开始更低)

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-10-03 10:43:14

调整line-height。来自规格说明

内嵌框的垂直填充、边框和边距从内容区域的顶部和底部开始,与“行高”无关。,但在计算行框的高度时只使用“行高”。

代码语言:javascript
复制
span {
  font-family: sans-serif;
  border-color: darkblue;
  border-style: solid;
  border-width: 5px;
}
代码语言:javascript
复制
<span style=" font-weight: normal; 
color: black; 
background-color: white; 
padding: 3px 3px 3px 7px;
text-align: center;">
    ℹ
</span>
<span style="
font-weight: bold;
color: white; 
background-color: darkblue;
padding: 3px 3px 3px 3px;
">
    This is some text
</span>
<span style=" 
font-weight: normal; 
color: black; 
background-color: white; 
padding: 3px 5px 3px 5px;
line-height:35px;
">
    This is more text, a longer one which will eventually fold. Some more words.
</span>

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52625213

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档