span 元素内的文本不在父 p 标签的宽度内换行
Text inside a span element does not wrap within the width the parent p tag
我有这个测试页,我看到文本环绕在父 p 元素内。但我遇到的问题是,当我试图在我的网站上做同样的事情时,我只看到 span 标签的第一行,其余文本在超出 [= 的宽度时被隐藏11=] 元素.
为了解决我的问题,我应该在 Chrome 开发者工具中查看什么?
<html>
<body>
<p style="width: 120px;">
<span>
Jellyfish or jellies[1] are softbodied, free-swimming aquatic animals with a gelatinous umbrella-shaped bell and trailing tentacles. The bell can pulsate to acquire propulsion and locomotion. The tentacles may be utilized to capture prey or defend against predators by emitting toxins in a painful sting. Jellyfish species are classified in the subphylum Medusozoa which makes up a major part of the phylum Cnidaria, although not all Medusozoa species are considered to be jellyfish.
</span>
</p>
</body>
</html>
您需要查看标签 p
或 span
的 word-wrap 禁令。 white-space: nowrap
或类似的东西。
我有这个测试页,我看到文本环绕在父 p 元素内。但我遇到的问题是,当我试图在我的网站上做同样的事情时,我只看到 span 标签的第一行,其余文本在超出 [= 的宽度时被隐藏11=] 元素.
为了解决我的问题,我应该在 Chrome 开发者工具中查看什么?
<html>
<body>
<p style="width: 120px;">
<span>
Jellyfish or jellies[1] are softbodied, free-swimming aquatic animals with a gelatinous umbrella-shaped bell and trailing tentacles. The bell can pulsate to acquire propulsion and locomotion. The tentacles may be utilized to capture prey or defend against predators by emitting toxins in a painful sting. Jellyfish species are classified in the subphylum Medusozoa which makes up a major part of the phylum Cnidaria, although not all Medusozoa species are considered to be jellyfish.
</span>
</p>
</body>
</html>
您需要查看标签 p
或 span
的 word-wrap 禁令。 white-space: nowrap
或类似的东西。