如何从我的网站上删除滚动条?解决方法不起作用
How to remove the scrollbar from my website ? Work arounds didn't work
我正在使用 React 框架来设计网站。该网站设计精良且完整。现在我看到我的网站在 y 轴上滚动。我见过类似 overflow:hidden 的解决方法,但屏幕设计会受到影响,因为它在顶部和底部都有边距。任何人都可以调查并告诉我答案吗?
GitHublink:
https://github.com/sandeyshc/ACME-frontend
网站link:
https://6127a673da25ff00079834e6--pedantic-goldberg-0f0184.netlify.app/
App.js
return(
<div className="grid grid-flow-col grid-rows-1 grid-cols-2 gap-0 helloss col-span-2" style={{backgroundColor:'black',padding:'4% 8%', resize:"contain"}}>
<div className={sizes} style={{backgroundColor:'#fff'}}>
<Login />
{/* style={{resizeMode: 'contain'}} */}
</div>
<div className="hellosm">
<img src={logoss}/>
</div>
</div>
);
App.css
img{
height: 100%;
}
@media only screen and (max-width: 768px) {
.hellosm{
display: none !important;
visibility: hidden !important;
}
}
使用 webkit-scrollbar
html::-webkit-scrollbar {
display: none;
}
/* Hide scrollbar for IE, Edge and Firefox */
html{
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
}
我正在使用 React 框架来设计网站。该网站设计精良且完整。现在我看到我的网站在 y 轴上滚动。我见过类似 overflow:hidden 的解决方法,但屏幕设计会受到影响,因为它在顶部和底部都有边距。任何人都可以调查并告诉我答案吗?
GitHublink: https://github.com/sandeyshc/ACME-frontend
网站link: https://6127a673da25ff00079834e6--pedantic-goldberg-0f0184.netlify.app/
App.js
return(
<div className="grid grid-flow-col grid-rows-1 grid-cols-2 gap-0 helloss col-span-2" style={{backgroundColor:'black',padding:'4% 8%', resize:"contain"}}>
<div className={sizes} style={{backgroundColor:'#fff'}}>
<Login />
{/* style={{resizeMode: 'contain'}} */}
</div>
<div className="hellosm">
<img src={logoss}/>
</div>
</div>
);
App.css
img{
height: 100%;
}
@media only screen and (max-width: 768px) {
.hellosm{
display: none !important;
visibility: hidden !important;
}
}
使用 webkit-scrollbar
html::-webkit-scrollbar {
display: none;
}
/* Hide scrollbar for IE, Edge and Firefox */
html{
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
}