如何水平裁剪文本?

发布于 2024-10-23 23:25:59 字数 699 浏览 6 评论 0原文

我需要将我的内容放在特定的容器中。如果内容水平增加,容器应该裁剪,如果内容垂直增加,容器应该扩展。这是我的代码:

<div style="padding:10px; width:602px; background:gold; clip: rect(0px, 602px, auto, 0px);">
  <div style="padding:10px; width:1000px; background:pink">
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea
  </div>
</div>

我也尝试使用溢出,但效果不佳。

这是我的实际代码 http://jsfiddle.net/QeahW/7/ 下拉 div 不是显示在“关于公司”链接下。不知道如何解决。

I need my content in a specific container. If the content increases horizontally, the container should crop, and if the content increases vertically the container should expand. here is my code:

<div style="padding:10px; width:602px; background:gold; clip: rect(0px, 602px, auto, 0px);">
  <div style="padding:10px; width:1000px; background:pink">
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea
  </div>
</div>

I also tried using overflow but it is not working well.

here is my actual code http://jsfiddle.net/QeahW/7/ the dropdown div is not showing under the about company link. dont know how to solve it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

生寂 2024-10-30 23:25:59

你的意思是你想要这样吗? : http://jsfiddle.net/N4qvK/

我删除了内部容器上的 widt,以便内部块始终与宽度保持在外部块内。

Do you mean you want it like this? : http://jsfiddle.net/N4qvK/

I removed the widt on the inner container so that the inner block always remains withing the outerblock with the width.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文