移动端盒子超出部分滚动,但没有滚动条

核心代码:

盒子{
    			overflow-y: scroll;
				-ms-overflow-style: none;
				overflow: -moz-scrollbars-none;
}
盒子::-webkit-scrollbar{
    			overflow-y: scroll;
				-ms-overflow-style: none;
				overflow: -moz-scrollbars-none;
}

完整代码:

DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>title>
	head>
	<body>
		<style>
			.box {
				display: flex;
				justify-content: center;
				flex-wrap: wrap;
				width: 200px;
				height: 400px;
				border: 1px solid red;
				overflow-y: scroll;
				-ms-overflow-style: none;
				overflow: -moz-scrollbars-none;
			}

			.box::-webkit-scrollbar {
				width: 0 !important
			}
			p{
			 box-shadow: 0 0 10px #e1dcdc;
			 width: 150px;
			 height: 40px;
			 text-align: center;
			 line-height: 40px;
			}
		style>
		<div class="box">
			<p>hello worldp>
			<p>hello worldp>
			<p>hello worldp>
			<p>hello worldp>
			<p>hello worldp>
			<p>hello worldp>
			<p>hello worldp>
			<p>hello worldp>
			<p>hello worldp>
			<p>hello worldp>
			<p>hello worldp>
		div>
	body>
html>

你可能感兴趣的:(前端,css,css3,前端)