Front-End Developer and UX/UI designer, with practical experience in project management, branding strategy, and creative direction; devoted to functional programming and information architecture.
<
Build a Personal Portfolio Webpage
Front-End Developer and UX/UI designer, with practical experience in project management, branding strategy, and creative direction; devoted to functional programming and information architecture.
<>>
Web Developer - User Experience Designer - Graphic Artist
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
在你自己写的style里
加上 margin-top:50px;
因为你的头部是position fixed的。
看到.navbar-fixed-top的position是fixed,所以<main>元素感知不到其存在被排到页面最上面,被.navbar-fixed-top遮盖掉了。
你可以把<header class="navbar navbar-inverse navbar-fixed-top">用一个<p>包裹起来,将这个p的height设置成和<header>的height一致,从而把下面的<main>元素挤下去。
先上一张图:

浏览器打开审查元素,这个
p的位置如图,由于你头部的header加了.navbar-fixed-topCSS 类,而这个类带有position: fixed属性,所以你的p元素被上面一个header元素盖住了。解决方法是,给下部
main部分加上一个上边距,等于头部header的高度,这样就可以把头部header的位置空出来了,也就不会被头部header挡住p元素了。效果:
