Html 即使存在';没有内容
我的网页正在向右滚动,尽管那里没有内容,只有空白。内容不超过100vw,如果我减少它,那么它不会填满页面 也许是我写的一些CSS造成的?我需要对代码进行哪些更改/添加才能修复此问题?谢谢 Home.css App.cssHtml 即使存在';没有内容,html,css,Html,Css,我的网页正在向右滚动,尽管那里没有内容,只有空白。内容不超过100vw,如果我减少它,那么它不会填满页面 也许是我写的一些CSS造成的?我需要对代码进行哪些更改/添加才能修复此问题?谢谢 Home.css App.css :root { --off-white: #fafafa; } .nav { background-color: var(--off-white); position: sticky; top: 0px;
:root {
--off-white: #fafafa;
}
.nav {
background-color: var(--off-white);
position: sticky;
top: 0px;
width: 100%;
height: 80px;
z-index: 1000;
box-shadow: 0 4px 14px 0 rgba(0, 0, 0, 0.15);
}
.nav-btn {
height: 60px;
width: 60px;
}
.nav .nav-content {
max-width: 900px;
padding: 0rem 3rem;
margin: 0 auto;
display: flex;
justify-content: space-between;
align-items: center;
height: 100%;
}
.nav-item {
display: inline;
top: 40px;
margin-left: 2rem;
color: white;
font-size: 18px;
z-index: 1;
position: relative;
}
.nav-item:hover {
color: black;
cursor: pointer;
}
.section-content {
max-width: 800px;
margin: 0 auto;
padding: 40px;
}
没有HTML代码就很难分析它。 但也许这句话是你的问题:
.section
{
..
left: -230px;
..
}
您是否尝试过溢出属性 { 溢出:隐藏
}是否也可以看到HTML?还是网页的链接?仅凭CSS很难区分。使用
*{padding:0;margin:0;框大小:border-box;}
而不是#wrapper{padding:0;margin:0;框大小:border-box;}
.section
{
..
left: -230px;
..
}