You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何使用CSS修正引号内文本跨段落拆分显示的问题

解决文本被拆分为多段落的CSS方案

问题根源在于引号内的文本片段被分别包裹在独立的<p>标签中,而<p>作为块级元素默认会独占一行,导致原本连续的文本被拆分显示。

你可以通过添加以下CSS规则修正:

/* 将分类名称内的p元素改为行内元素,实现文本连续显示 */
.custom-image-cat-style-2 .tbay-element-custom-image-list-categories.widget-categories.widget-grid .item-cat .cat-name p {
    display: inline;
    /* 可选:添加少量右侧间距,让单词间的排版更自然 */
    margin-right: 5px;
}

/* 保留你原有的分类名称样式 */
.custom-image-cat-style-2 .tbay-element-custom-image-list-categories.widget-categories.widget-grid .item-cat .cat-name {
    top: 105px;
    left: 42px;
    right: auto;
    color: #000000;
    font-size: 13px;
}

如果需要文本在一行放不下时自动换行(而非强制单行),可以将display: inline替换为display: inline-block,同时给父元素.cat-name添加white-space: normal以确保正常的换行逻辑。

内容的提问来源于stack exchange,提问作者Bharat Sharma

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.25 18:09:23