我目前正在关注这个 HTML/SCSS/JavaScript 教程:https://www.youtube.com/watch?v=7WaohfclZRs&list=PLillGF-RfqbYoGoCjKoMOkVznV6aSXKzU&index=3 .
我相信我做了视频中的所有操作,但我的菜单按钮位置不正确。
.menu-btn {
position: absolute;
z-index: 3;
cursor: pointer;
right: 35px;
top: 35px;
@include ease-out;}
header {
position: fixed;
z-index: 2; }
<body id="bg-img">
<div class="overlay"></div>
<header>
<div class="menu-btn">
<div class="btn-line"></div>
<div class="btn-line"></div>
<div class="btn-line"></div>
</div>
</header>
</body>
前两个片段来 self 的 _menu.scss 和 main.scss 文件,最后一个片段来 self 的 index.html 文件。
Here's how it should look like
And here's how it is looking like right now
感谢您的帮助!!
最佳答案
如您所见。你的标题有点短......所以尝试添加 width: 100%; - 这应该使该菜单全宽。
header{
width:100%;
}
关于html - 菜单按钮定位,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58165997/