如何水平裁剪文本?
我需要将我的内容放在特定的容器中。如果内容水平增加,容器应该裁剪,如果内容垂直增加,容器应该扩展。这是我的代码:
<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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你的意思是你想要这样吗? : 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.