Html 如果父div大小较小,请在滚动条上指定一个div
我有固定大小的子div,当液体父div的宽度小于子div时,我希望将子div保持在父div内,并给子div提供滚动条。 HTMLHtml 如果父div大小较小,请在滚动条上指定一个div,html,css,Html,Css,我有固定大小的子div,当液体父div的宽度小于子div时,我希望将子div保持在父div内,并给子div提供滚动条。 HTML 添加溢出:自动到父容器: .parent{ height: 100%; width: 100%; background-color: red; padding: 50px; width: auto; overflow: auto; } 很酷,但我现在如何才能接触到右侧孩子的内容?使用滚动条?我想我不明白 .child{
添加
溢出:自动代码>到父容器:
.parent{
height: 100%;
width: 100%;
background-color: red;
padding: 50px;
width: auto;
overflow: auto;
}
很酷,但我现在如何才能接触到右侧孩子的内容?使用滚动条?我想我不明白
.child{
width: 500px;
height: 400px;
background-color: green;
}
.parent{
height: 100%;
width: 100%;
background-color: red;
padding: 50px;
width: auto;
}
.parent{
height: 100%;
width: 100%;
background-color: red;
padding: 50px;
width: auto;
overflow: auto;
}