html - 在 <div> 中插入另一个 <div> 时,当我不想要时文本中断

标签 html css word-wrap

我正在制作自己的网站,当我在另一个 div 中插入 div 时,换行符。我该如何解决这个问题?

    .subt {
    font-size: 21.75px;
    font-weight: bold;
    font-style: italic;
    }
    .norm {
    font-size: 19.5px;
    word-wrap: break-word;
    }
    .god {
    font-style: italic;
    }
    <pre>
    <div class="normal"><b>3</b> Ent Jous dit alors: « <div class="god">Que la loumin soiz!</div> » Ent la loumin fut</div></pre>

最佳答案

您需要为您的 .god 类设置 display:inline-block;display:inline;

.god {
font-style: italic;
display:inline-block;
}

.subt {
font-size: 21.75px;
font-weight: bold;
font-style: italic;
}
.norm {
font-size: 19.5px;
word-wrap: break-word;
}
.god {
font-style: italic;
display:inline-block;
}
<style> 


</style>
<pre>
<div class="normal"><b>3</b> Ent Jous dit alors: « <div class="god">Que la loumin soiz!</div> » Ent la loumin fut</div></pre>

关于html - 在 <div> 中插入另一个 <div> 时,当我不想要时文本中断,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56042392/

相关文章:

php - Wordpress 同一查询中前 4 个帖子的不同 html/css

html - 如何使div在不同尺寸下保持相同的格式

javascript - 改变 <li> 的背景颜色看起来很有趣

html - tm 符号不会像在 html 中那样显示,sm 符号可以工作

git - 我应该如何对长行使用 git diff?

java - 换行属性 JEditorPane

javascript - 为什么我会因为这个 Javascript 函数而失去利润

css - IE8 表格行渐变过滤器不显示在表格单元格中

css - 图库图像在 IE 中换行,但在其他浏览器中不换行

jquery - 向上/向下滚动到带有固定按钮的部分