首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >文本不在div中

文本不在div中
EN

Stack Overflow用户
提问于 2013-10-18 03:52:54
回答 3查看 28.9K关注 0票数 8

我有一个div,文本不会留在里面,我不知道为什么,我以前从来没有遇到过这个问题,我希望有人能帮助我,这是我的代码:

HTML:

代码语言:javascript
复制
#toronto-content {
  position: relative;
  z-index: 98;
  height: 100%;
  width: 700px;
  background-color: #0A0A0A;
  color: #FFF;
}
代码语言:javascript
复制
<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/

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2013-10-18 03:56:27

这将解决您的问题:

代码语言:javascript
复制
#toronto-content {
  white-space: normal;
}

但我会考虑将文本放入<p><span>标记中。

票数 15
EN

Stack Overflow用户

发布于 2013-10-18 04:11:15

这是因为文本的数量大于div

我建议在样式中添加overflow:overlay,这将在内容旁边创建一个垂直滚动条。

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

如果这不是你想要的,你应该在有太多内容的时候添加页面(称为“分页”),或者用Javascript或jQuery制作一个自定义的垂直滚动条。

票数 4
EN

Stack Overflow用户

发布于 2017-12-17 20:30:53

添加这个

代码语言:javascript
复制
#toronto-content {
  white-space: normal;
  overflow: hidden;
}
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19435967

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档