超出父容器时不要滚动条但是要滚动条效果

<html>
<head>
<title>留滚动效果,去除滚动条</title>
</head>
<style>

</style>
<body >


<div id='father' style='overflow:hidden;background-color:yellow; width: 500px;height:250px;'>
<div id='son' style='background-color:red;width:530px;height:250px;overflow-y:auto;'>
<p style="height: 900px;">我是内容</p>
</div>
</div>


</body>
<script>

</script>
</html>

猜你喜欢

转载自blog.csdn.net/weixin_34849724/article/details/80661098