文字不留在div里面

时间:2013-10-17 19:52:54

标签: css

我有一个div,文本将不会留下来,我不知道为什么,我从来没有碰到这个问题,我希望有些人可以帮助我,继承我的代码:

HTML:

#toronto-content {
  position: relative;
  z-index: 98;
  height: 100%;
  width: 700px;
  background-color: #0A0A0A;
  color: #FFF;
}
<div id="toronto-content">

  Interactively pursue long-term high-impact vortals and distributed systems. Competently streamline team driven testing procedures without leading-edge intellectual capital. Energistically engage market-driven catalysts for change via client-centered technologies.
  Compellingly architect long-term high-impact intellectual capital and resource-leveling interfaces. Phosfluorescently initiate market positioning supply chains with stand-alone processes. Collaboratively generate leading-edge services for synergistic
  e-markets. Conveniently syndicate bleeding-edge resources whereas equity invested scenarios. Collaboratively parallel task backward-compatible deliverables and business relationships. Assertively implement turnkey niche markets for technically sound
  human capital. Collaboratively integrate pandemic niche markets with corporate action items. Quickly utilize timely paradigms after best-of-breed infomediaries. Appropriately drive future-proof initiatives via standards compliant opportunities. Uniquely
  coordinate 24/365 mindshare vis-a-vis top-line synergy. Phosfluorescently benchmark one-to-one mindshare with high-payoff best practices. Distinctively supply principle-centered relationships whereas revolutionary relationships.

</div>

如果您想在此处查看完整网站:http://lasociete.ca/new/

3 个答案:

答案 0 :(得分:10)

这将解决您的问题:

#toronto-content {
  white-space: normal;
}

但我会考虑将您的文字放入<p><span>标记。

答案 1 :(得分:3)

那是因为文本量大于div
我建议在您的样式中添加overflow:overlay,这会在内容旁边创建一个垂直滚动条。

如果添加overflow:scroll,即使不需要,也会创建一个水平滚动条。

如果这不是您想要的,您应该在内容太多时添加页面(称为“分页”),或者使用Javascript或jQuery创建自定义垂直滚动条。

答案 2 :(得分:0)

添加此

#toronto-content {
  white-space: normal;
  overflow: hidden;
}