溢出:自动 - 没有右侧填充和填充边距、镀铬
问题是父div中没有右内边距,子div中没有右外边距。我正在使用铬。
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Template</title>
</head>
<body>
<div style = "padding: 50px; overflow: auto; width: 300px; height: 300px; background-color: red;">
<div style = "width: 500px; height: 500px; background-color: green;"></div>
</div>
<hr />
<div style = "overflow: auto; width: 300px; height: 300px; background-color: red;">
<div style = "margin: 50px; width: 500px; height: 500px; background-color: green;"></div>
</div>
</body>
</html>
The problem is that there is no right padding in the parent div and no right margin in the child div. I am using chrome.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Template</title>
</head>
<body>
<div style = "padding: 50px; overflow: auto; width: 300px; height: 300px; background-color: red;">
<div style = "width: 500px; height: 500px; background-color: green;"></div>
</div>
<hr />
<div style = "overflow: auto; width: 300px; height: 300px; background-color: red;">
<div style = "margin: 50px; width: 500px; height: 500px; background-color: green;"></div>
</div>
</body>
</html>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了填充的解决方案,不幸的是它不适用于边距:
I found the solution for padding, unfortunately it does not work with margin: