我有一个非常简单的网站
<body>
<header>
<nav class="main-nav-container">
<div class="admin-panel-label">Admin panel</div>
<div class="main-breadcrumb"><a class="previous-breadcrumb">Blog</a><a>/</a><a
class="previous-breadcrumb">Posts</a><a>/</a><a>I am the post</a></div>
<div class="user-panel">
<img src="/uploads/profilePics/defaultProfilePic.jpg">
<a>{{{user.profile.name}}}</a>
<i class="fas fa-caret-down"></i>
</div>
</nav>
</header>
<div class="admin-panel">
<div class="dashboard-tab admin-panel-active-tab"><i class="fas fa-columns"></i>Dashboard</div>
<div class="users-tab"><i class="fas fa-users"></i>Users</div>
<div class="blog-tab"><i class="fas fa-pen"></i>Blog</div>
<div class="eshop-tab"><i class="fas fa-store"></i>Eshop</div>
</div>
<div class="main-content"> // <---- main content
{{{body}}}
</div>
</body>
但是问题是,当我向margin-top
添加.main-content
时,它也会影响<body>
,并且<body>
从顶部移到与.main-content
相同的值
如果有任何解决方法,我将非常感谢。不知道为什么会这样。