【问题标题】:Text inside a span element does not wrap within the width the parent p tagspan 元素内的文本不会在父 p 标签的宽度内换行
【发布时间】:2017-02-12 09:29:29
【问题描述】:

我有这个测试页面,我看到文本被包裹在 Parent p 元素中。但是我遇到的问题是,当我尝试在我的网站上做同样的事情时,我只看到 span 标签的第一行,而其余的文本在它们超出 @987654321 的宽度时被隐藏了@元素。

为了解决我的问题,我应该在 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>

【问题讨论】:

    标签: html css developer-tools


    【解决方案1】:

    您需要查看标签 pspan 的自动换行禁令。 white-space: nowrap 或类似的东西。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-10-03
      • 2013-09-05
      • 2014-08-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-11-03
      相关资源
      最近更新 更多