admin管理员组文章数量:1516870
Context
I have a bunch of nested DIVs (implementing a simple window system, for learning purposes, with DIVs).
Problem:
Let divA = child of divB.
Now, ideally, I want the contents of divA to be "clipped" inside of divB.
Thus, if I take divA, and drag it to the right ... as it gets out of the border of divB, I want the parts of divA that are outside of divB to be chopped off and not displayed.
Question:
How do I do this? How do I use one div to clip / mask another div?
Thanks!
Context
I have a bunch of nested DIVs (implementing a simple window system, for learning purposes, with DIVs).
Problem:
Let divA = child of divB.
Now, ideally, I want the contents of divA to be "clipped" inside of divB.
Thus, if I take divA, and drag it to the right ... as it gets out of the border of divB, I want the parts of divA that are outside of divB to be chopped off and not displayed.
Question:
How do I do this? How do I use one div to clip / mask another div?
Thanks!
Share Improve this question asked Jul 6, 2012 at 8:08 user1311390user13113902 Answers
Reset to default 6It's called:
.divA {
overflow: hidden;
}
w3 schools
Use the css overflow property. Follow this link to see what values there are for overflow
本文标签: javascriptCSS Clip to be inside parent DIVStack Overflow
版权声明:本文标题:JavaScript, CSS: Clip to be inside parent DIV - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.betaflare.com/web/1745663365a2669137.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论