粘性导航栏,滚动到第一个元素不精确

如何解决粘性导航栏,滚动到第一个元素不精确

我正在尝试制作一个导航栏,该导航栏在滚动到第一个元素后会停留在顶部,例如'新闻'。通过点击“新闻”来进行不精确的工作。它向下滚动很多,在再次按下“新闻”之后,它又向上滚动回到了正确的位置。奇怪的是,它仅发生在navBar的第一个元素上。我该如何解决?

/*Base*/
.contentBody{
  background-color: white;
}

/*Sections*/
html {
  scroll-behavior: smooth;
}
#header{}
#news{}
#products{background-color: aqua;}
#services{}
#customers{}
#community{}
#contact{}
#about{}
#footer{}
/*Width Element*/
.fitWidth{
  width: -webkit-fill-available;
}
.width100{
  width: 100%;
}
.fitContBoxLeft{
  display: inline-block;
  float: left;
}
.fitContBoxRight{
  display: inline-block;
  float: right;
}
/**/


/*Borders*/
.roundedBorader{
  border-radius: 50%;
}
.roundedBox{
    border: 1px solid lightgrey;
    border-radius: 12px;
}
/*Div*/
.headingBox{
  position: relative
  background-color: lightgrey;
  height: 268;
}
.news{
  background-color: purple;
}
.products{
  background-color: white;
}
.services{
  background-color: limegreen;
}
.customers{
  background-color: blue;
}
.pBox1{
  float:left;
  width: 24.7%;
  margin: 1px;
  border-radius: 5px;
  text-align: center;
}
.headBottomLine{
  height: 12%;
  width: 100%;
  background-color: grey;
}
.leftBox50{
  height: auto;
  float: left;
  background-color: white;
  width: 49%;
  margin: 2px;
}
.rightBox50{
  height: auto;
  float: left;
  background-color: white;
  width: 49%;
  margin: 2px;
}
.bodyBox{
  height: 200px;
  background-color: grey;
}
.aboutUs{
  height: 200px;
  background-color: white;
}
.footerBox{
  min-height: 300px;
  background-color: black;
}

/*Backgrounds*/
.headBG{
  background-image: url("https://www.toptal.com/designers/subtlepatterns/patterns/double-bubble.png");
  background-size: cover;
}

/*Position*/
.bottom0{
  bottom: 0;
}
.posRel{
  position: relative;
}
.posAbs{
  position: absolute;
}

/*Float*/
.floatLeft{
  float: left;
}
.floatRight{
  float: right;
}

/*Alignment*/
.justiText{
  text-align: justify;
}
.rightText{
  text-align: right;
}
.leftText{
  text-align: left;
}
.centerText{
  text-align: center;
}
.alignBox{
  display: flex;
  justify-content: center;
}

/*Padding*/
.pAll-5{
  padding: 5%;
}
.pTop-8{
  padding-top: 8%;
}
.pTop-5{
  padding-top: 5%;
}
.pTop-2{
  padding-top: 2%;
}
.mTop-n3{
  margin-top: -3%;
}
.mTop-5{
  margin-top: auto;
}
.mTop-6{
  margin-top: 6%;
}
.pLine{
  width:100%;
}
.pLR{
  padding-left: 5%;
  padding-right: 5%;
}
.pBot-12{
  padding-bottom: 12%;
}
.pTop-10{
  padding-top: 10%;
}
.pTop-6{
    padding-top: 6%;
}
.pTop-1{
  padding-top: 2%;
}
.pLeft-30{
  padding-left: 30%;
}
.pLeft-25{
  padding-left: 25%;
}
.pLeft-20{
  padding-left: 20%;
}
.pLeft-10{
  padding-left: 10%;
}
.pLeft-5{
  padding-left: 5%;
}
.pRight-5{
  padding-right: 5%;
}
.pTop-4{
  padding-top: 4%;
}
.pAll-20{
  padding: 20px;
}
.pLTRB{
    padding-left: 15%;
    padding-top: 2%;
    padding-bottom: 5%;
}
.centerHeadLine{
    padding-bottom: 7%;
}

/*Colors*/
.white{
  color: white;
}
.black{
  color: black;
}
.grey{
  color: grey;
}
.lightgrey{
  color: lightgrey;
}
div.c{
  color: lightgrey;
}
div.b{
  color: white;
}
div.a{
  color: black;
}
.bgCol-black{
  background-color: black;
}
.bgCol-grey{
  background-color: grey;
}
.bgCol-purple{
  background-color: #8e42c7;
}
.bgCol-white{
  background-color: white;
}
.bgCol-lightgrey{
  background-color: lightgrey;
}
.bgCol-limegreen{
  background-color: limegreen;
}
.bgLightGreyX{
  background-color: #d5d2d670;
}

/*Filter styles*/
.saturate { filter: saturate(3); }
.grayscale { filter: grayscale(100%); }
.contrast { filter: contrast(160%); }
.brightness { filter: brightness(0.25); }
.blur { filter: blur(3px); }
.invert { filter: invert(100%); }
.sepia { filter: sepia(100%); }
.huerotate { filter: hue-rotate(180deg); }
.rss.opacity { filter: opacity(50%); }

/*Heading Colors*/
h1.a{
  color: white;
}
h1.b{
  color: black;
}
h5.a{
  color: white;
}
h4.b{
  color: black;
}
h4.a{
  color: white;
}
h5.b{
  color: black;
}

/*Body*/
body {
  margin: 0;
  font-size: 20px;
  font-family: Arial,Helvetica,sans-serif;
}

/*NavBar*/
.navbar {
  overflow: hidden;
  background-color: #333;
}

.navbar a {
  float: left;
  font-size: 16px;
  color: white;
  text-align: center;
  padding: 14px 16px;
  text-decoration: none;
}
/*Nav-Dropdown*/
.dropdown {
  float: left;
  overflow: hidden;
}

.dropdown .dropbtn {
  font-size: 16px;  
  border: none;
  outline: none;
  color: white;
  padding: 14px 16px;
  background-color: inherit;
  font-family: inherit;
  margin: 0;
}

.navbar a:hover,.dropdown:hover .dropbtn {
  background-color: #ea8013;
}

.dropdown-content {
  display: none;
  position: fixed;
  background-color: #333;
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0,0.2);
  z-index: 1;
}

.dropdown-content a {
  float: none;
  color: white;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  text-align: left;
}

.dropdown-content a:hover {
  background-color: #94a25c;
}

.dropdown:hover .dropdown-content {
  display: block;
}


/* The sticky class*/

.sticky {
  position: fixed;
  top: 0;
  width: 100%;
}

.sticky + .content {
  padding-top: 0px;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<!---------------------------------------------------Header--------------------------------------------------->
<div class='headBG posRel' id='home'>
  <div class='pTop-4 pLeft-10'>
    <img class='floatLeft roundedBorader' src='https://pbs.twimg.com/media/EaZSuXXXkAAMtJ5?format=jpg&name=360x360' height="150" width="150"/>
    <div class='centerHeadLine pLeft-25'>
      <h1 class='b'>Welcome friends</h1>
      <h5 class='b'><u>The spot where we test some html,css and js</u></h5>
    </div>
  </div>
  <!--NAV-->
  <div class="navbar fitWidth" id="navbar">
      <a class="active" href="#home">Home</a>
      <a class="" href="#news">News</a>
      <a class="" href="#products">Products</a>
      <a class="" href="#services">Services</a>
      <a class="" href="#customers">Customers</a>
      <a class="" href="#community">Community</a>
      <a class="" href="#contact">Contact</a>
    <div class="dropdown">
      <button class="dropbtn">About 
        <i class="fa fa-caret-down"></i>
      </button>
      <div class="dropdown-content">
     <!-- //TODO: Modals als POP up einbauen,mit jeweiligen content -->
        <a href="#">Link 1</a>
        <a href="#">Link 2</a>
        <a href="#">Link 3</a>
      </div>
    </div> 
  </div>
</div>
<!---------------------------------------------------Content-------------------------------------------------->
<div class='contentBody'>
  <!--News-->
   <div class='news' id="news">

      <h1 class='a centerText pTop-5 mTop-5'>News</h1>
      <h5 class='a centerText'>Stay tunned with our News</h5>

    <div class='alignBox'>
      <div class='leftBox50 alignBox roundedBox'> 
        <div class='centerText'>
          <h4>Lorem ipsum</h4>
          <p>Lorem ipsum dolor sit amet,consetetur sadipscing elitr,sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>        
        </div>
      </div>
      <div class='rightBox50 alignBox roundedBox'>
        <div class='centerText'>
          <h4>Lorem ipsum</h4>
          <p>Lorem ipsum dolor sit amet,no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>        
        </div>        
      </div>  
   </div>
    <div class='alignBox pAll-20' id=''>
      <form action="/action_page.php">
        <label class='white' for="lname">Newsletter:</label>
        <input type="text" id="lname" name="lname">
        <input type="submit" value="Submit">
      </form>
    </div>
   </div>
  <!--//News-->
  
  <!--Products-->
  <div class='products' id='products'>
    <h1 class='centerText pTop-6 mTop-5'>Products</h1>
    <h5 class='b centerText'>Stay tunned with our products</h5>
    <div class='leftText pAll-20'>
        <h4>Lorem ipsum</h4>
        <p>Lorem ipsum dolor sit amet,no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>
      </div>    
    <div class='pAll-20'>
      <div class='white pBox1 bgLightGreyX'>
        <img class='pTop-5' src='https://via.placeholder.com/150'/><br>
        <p>Product #1</p>
      </div>
      <div class='white pBox1 bgLightGreyX'>
        <img class='pTop-5' src='https://via.placeholder.com/150'/><br>
        <p>Product #2</p>
      </div>
      <div class='white pBox1 bgLightGreyX'>
        <img class='pTop-5' src='https://via.placeholder.com/150'/><br>
        <p>Product #3</p>
      </div>
      <div class='white pBox1 bgLightGreyX'>
        <img class='pTop-5' src='https://via.placeholder.com/150'/><br>
        <p class='black'>Product #4</p>
      </div>
     </div>
    <div class='pTop-10 pLR'>
      <p>Lorem ipsum dolor sit amet,no sea takimata sanctus e</p>
    </div>
  </div>
  <!--//Products-->
  <!--Services-->
  <div class='services' id='services'>
    <h1 class='centerText pTop-5 mTop-5'>tile#1</h1>
    <h5 class='b centerText'>Stay tunned with our Services</h5>
    
    <div class='pLeft-5 fitContBoxLeft roundedBox'>
      <img class='floatLeft' src='https://via.placeholder.com/50'/><br>
      <div class='floatLeft pLeft-5'>tile#2</div>
    </div>
    
    <div class='pRight-5 fitContBoxRight roundedBox'>
      <img class='floatRight' src='https://via.placeholder.com/50'/><br>
      <div class='floatRight pRight-5'>tile#3</div>
    </div>
    
    <div class='pLeft-5 fitContBoxLeft roundedBox'>
      <img class='floatLeft' src='https://via.placeholder.com/50'/><br>
      <div class='floatLeft pLeft-5'>tile#4</div>
    </div>
    
    <div class='pRight-5 fitContBoxRight roundedBox'>
      <img class='floatRight' src='https://via.placeholder.com/50'/><br>
      <div class='floatRight pRight-5'>tile#5</div>
    </div>
    
    <h4 class='centerText pTop-5'>asdfadsf asdf  asdf asd f asdfvices</h4>
    <div class=''></div>
  </div>
  <!--//Services-->
  <!--Customers-->
  <div class='customers' id='customers'>
    <h1 class='a centerText'>Customers</h1>
    <div class=''></div>
    <div class=''></div>
    <p>jgfjhgfghjf</p>
  </div>
  <!--//Customers-->
  <!--Community-->
  <div class='' id='Community'>
    <h1 class='a centerText'>Community</h1>
    <div class=''></div>
    <div class=''></div>
  </div>
  <!--//Community-->
  <!--Contact-->
  <div class='' id='Contact'>
    <h1 class='a centerText'>Contact</h1>
    <div class=''></div>
    <div class=''></div>
  </div>
  <!--//Contact-->
  <!--About-->
  <div class='aboutUs'>
    <div></div>
  </div>
  <!--//About-->
</>
<!---------------------------------------------------Footer--------------------------------------------------->
<div class='footerBox'>
  <div></div>
</div>
parser.hooks.call
    .for("require")
    .tap("CompatibilityPlugin",expr => {
    // support for browserify style require delegator: "require(o,!0)"
    if (expr.arguments.length !== 2) return;
    ...

解决方法

您需要将其更改为JS / JQuery,在我的情况下为JQuery。添加此脚本,您将拥有更多控制权,并且如果将,0更改为毫秒,则可以制作动画。请注意,我是从容器位置减去导航栏高度。

$(document).ready(function(){
  $("#navbar a").click(function(e) {
    e.preventDefault();
    $('html,body').animate({
      scrollTop: $($.attr(this,'href')).offset().top - $("#navbar").height()
    },0);
  });
});

//Sticky-NavBar
window.onscroll = function() {stickyNavBar()};
var navbar = document.getElementById("navbar");
var sticky = navbar.offsetTop;
function stickyNavBar() {
  if (window.pageYOffset >= sticky) {
    navbar.classList.add("sticky")
  } else {
    navbar.classList.remove("sticky");
  }
}

$(document).ready(function(){
  $("#navbar a").click(function(e) {
    e.preventDefault();
    $('html,0);
  });
});
/*Base*/
.contentBody{
  background-color: white;
}

/*Sections*/
html {
  scroll-behavior: smooth;
}
#header{}
#news{}
#products{background-color: aqua;}
#services{}
#customers{}
#community{}
#contact{}
#about{}
#footer{}
/*Width Element*/
.fitWidth{
  width: -webkit-fill-available;
}
.width100{
  width: 100%;
}
.fitContBoxLeft{
  display: inline-block;
  float: left;
}
.fitContBoxRight{
  display: inline-block;
  float: right;
}
/**/


/*Borders*/
.roundedBorader{
  border-radius: 50%;
}
.roundedBox{
    border: 1px solid lightgrey;
    border-radius: 12px;
}
/*Div*/
.headingBox{
  position: relative
  background-color: lightgrey;
  height: 268;
}
.news{
  background-color: purple;
}
.products{
  background-color: white;
}
.services{
  background-color: limegreen;
}
.customers{
  background-color: blue;
}
.pBox1{
  float:left;
  width: 24.7%;
  margin: 1px;
  border-radius: 5px;
  text-align: center;
}
.headBottomLine{
  height: 12%;
  width: 100%;
  background-color: grey;
}
.leftBox50{
  height: auto;
  float: left;
  background-color: white;
  width: 49%;
  margin: 2px;
}
.rightBox50{
  height: auto;
  float: left;
  background-color: white;
  width: 49%;
  margin: 2px;
}
.bodyBox{
  height: 200px;
  background-color: grey;
}
.aboutUs{
  height: 200px;
  background-color: white;
}
.footerBox{
  min-height: 300px;
  background-color: black;
}

/*Backgrounds*/
.headBG{
  background-image: url("https://www.toptal.com/designers/subtlepatterns/patterns/double-bubble.png");
  background-size: cover;
}

/*Position*/
.bottom0{
  bottom: 0;
}
.posRel{
  position: relative;
}
.posAbs{
  position: absolute;
}

/*Float*/
.floatLeft{
  float: left;
}
.floatRight{
  float: right;
}

/*Alignment*/
.justiText{
  text-align: justify;
}
.rightText{
  text-align: right;
}
.leftText{
  text-align: left;
}
.centerText{
  text-align: center;
}
.alignBox{
  display: flex;
  justify-content: center;
}

/*Padding*/
.pAll-5{
  padding: 5%;
}
.pTop-8{
  padding-top: 8%;
}
.pTop-5{
  padding-top: 5%;
}
.pTop-2{
  padding-top: 2%;
}
.mTop-n3{
  margin-top: -3%;
}
.mTop-5{
  margin-top: auto;
}
.mTop-6{
  margin-top: 6%;
}
.pLine{
  width:100%;
}
.pLR{
  padding-left: 5%;
  padding-right: 5%;
}
.pBot-12{
  padding-bottom: 12%;
}
.pTop-10{
  padding-top: 10%;
}
.pTop-6{
    padding-top: 6%;
}
.pTop-1{
  padding-top: 2%;
}
.pLeft-30{
  padding-left: 30%;
}
.pLeft-25{
  padding-left: 25%;
}
.pLeft-20{
  padding-left: 20%;
}
.pLeft-10{
  padding-left: 10%;
}
.pLeft-5{
  padding-left: 5%;
}
.pRight-5{
  padding-right: 5%;
}
.pTop-4{
  padding-top: 4%;
}
.pAll-20{
  padding: 20px;
}
.pLTRB{
    padding-left: 15%;
    padding-top: 2%;
    padding-bottom: 5%;
}
.centerHeadLine{
    padding-bottom: 7%;
}

/*Colors*/
.white{
  color: white;
}
.black{
  color: black;
}
.grey{
  color: grey;
}
.lightgrey{
  color: lightgrey;
}
div.c{
  color: lightgrey;
}
div.b{
  color: white;
}
div.a{
  color: black;
}
.bgCol-black{
  background-color: black;
}
.bgCol-grey{
  background-color: grey;
}
.bgCol-purple{
  background-color: #8e42c7;
}
.bgCol-white{
  background-color: white;
}
.bgCol-lightgrey{
  background-color: lightgrey;
}
.bgCol-limegreen{
  background-color: limegreen;
}
.bgLightGreyX{
  background-color: #d5d2d670;
}

/*Filter styles*/
.saturate { filter: saturate(3); }
.grayscale { filter: grayscale(100%); }
.contrast { filter: contrast(160%); }
.brightness { filter: brightness(0.25); }
.blur { filter: blur(3px); }
.invert { filter: invert(100%); }
.sepia { filter: sepia(100%); }
.huerotate { filter: hue-rotate(180deg); }
.rss.opacity { filter: opacity(50%); }

/*Heading Colors*/
h1.a{
  color: white;
}
h1.b{
  color: black;
}
h5.a{
  color: white;
}
h4.b{
  color: black;
}
h4.a{
  color: white;
}
h5.b{
  color: black;
}

/*Body*/
body {
  margin: 0;
  font-size: 20px;
  font-family: Arial,Helvetica,sans-serif;
}

/*NavBar*/
.navbar {
  overflow: hidden;
  background-color: #333;
}

.navbar a {
  float: left;
  font-size: 16px;
  color: white;
  text-align: center;
  padding: 14px 16px;
  text-decoration: none;
}
/*Nav-Dropdown*/
.dropdown {
  float: left;
  overflow: hidden;
}

.dropdown .dropbtn {
  font-size: 16px;  
  border: none;
  outline: none;
  color: white;
  padding: 14px 16px;
  background-color: inherit;
  font-family: inherit;
  margin: 0;
}

.navbar a:hover,.dropdown:hover .dropbtn {
  background-color: #ea8013;
}

.dropdown-content {
  display: none;
  position: fixed;
  background-color: #333;
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0,0.2);
  z-index: 1;
}

.dropdown-content a {
  float: none;
  color: white;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  text-align: left;
}

.dropdown-content a:hover {
  background-color: #94a25c;
}

.dropdown:hover .dropdown-content {
  display: block;
}


/* The sticky class*/

.sticky {
  position: fixed;
  top: 0;
  width: 100%;
}

.sticky + .content {
  padding-top: 0px;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<!---------------------------------------------------Header--------------------------------------------------->
<div class='headBG posRel' id='home'>
  <div class='pTop-4 pLeft-10'>
    <img class='floatLeft roundedBorader' src='https://pbs.twimg.com/media/EaZSuXXXkAAMtJ5?format=jpg&name=360x360' height="150" width="150"/>
    <div class='centerHeadLine pLeft-25'>
      <h1 class='b'>Welcome friends</h1>
      <h5 class='b'><u>The spot where we test some html,css and js</u></h5>
    </div>
  </div>
  <!--NAV-->
  <div class="navbar fitWidth" id="navbar">
      <a class="active" href="#home">Home</a>
      <a class="" href="#news">News</a>
      <a class="" href="#products">Products</a>
      <a class="" href="#services">Services</a>
      <a class="" href="#customers">Customers</a>
      <a class="" href="#community">Community</a>
      <a class="" href="#contact">Contact</a>
    <div class="dropdown">
      <button class="dropbtn">About 
        <i class="fa fa-caret-down"></i>
      </button>
      <div class="dropdown-content">
     <!-- //TODO: Modals als POP up einbauen,mit jeweiligen content -->
        <a href="#">Link 1</a>
        <a href="#">Link 2</a>
        <a href="#">Link 3</a>
      </div>
    </div> 
  </div>
</div>
<!---------------------------------------------------Content-------------------------------------------------->
<div class='contentBody'>
  <!--News-->
   <div class='news' id="news">

      <h1 class='a centerText pTop-5 mTop-5'>News</h1>
      <h5 class='a centerText'>Stay tunned with our News</h5>

    <div class='alignBox'>
      <div class='leftBox50 alignBox roundedBox'> 
        <div class='centerText'>
          <h4>Lorem ipsum</h4>
          <p>Lorem ipsum dolor sit amet,consetetur sadipscing elitr,sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>        
        </div>
      </div>
      <div class='rightBox50 alignBox roundedBox'>
        <div class='centerText'>
          <h4>Lorem ipsum</h4>
          <p>Lorem ipsum dolor sit amet,no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>        
        </div>        
      </div>  
   </div>
    <div class='alignBox pAll-20' id=''>
      <form action="/action_page.php">
        <label class='white' for="lname">Newsletter:</label>
        <input type="text" id="lname" name="lname">
        <input type="submit" value="Submit">
      </form>
    </div>
   </div>
  <!--//News-->
  
  <!--Products-->
  <div class='products' id='products'>
    <h1 class='centerText pTop-6 mTop-5'>Products</h1>
    <h5 class='b centerText'>Stay tunned with our products</h5>
    <div class='leftText pAll-20'>
        <h4>Lorem ipsum</h4>
        <p>Lorem ipsum dolor sit amet,no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>
      </div>    
    <div class='pAll-20'>
      <div class='white pBox1 bgLightGreyX'>
        <img class='pTop-5' src='https://via.placeholder.com/150'/><br>
        <p>Product #1</p>
      </div>
      <div class='white pBox1 bgLightGreyX'>
        <img class='pTop-5' src='https://via.placeholder.com/150'/><br>
        <p>Product #2</p>
      </div>
      <div class='white pBox1 bgLightGreyX'>
        <img class='pTop-5' src='https://via.placeholder.com/150'/><br>
        <p>Product #3</p>
      </div>
      <div class='white pBox1 bgLightGreyX'>
        <img class='pTop-5' src='https://via.placeholder.com/150'/><br>
        <p class='black'>Product #4</p>
      </div>
     </div>
    <div class='pTop-10 pLR'>
      <p>Lorem ipsum dolor sit amet,no sea takimata sanctus e</p>
    </div>
  </div>
  <!--//Products-->
  <!--Services-->
  <div class='services' id='services'>
    <h1 class='centerText pTop-5 mTop-5'>tile#1</h1>
    <h5 class='b centerText'>Stay tunned with our Services</h5>
    
    <div class='pLeft-5 fitContBoxLeft roundedBox'>
      <img class='floatLeft' src='https://via.placeholder.com/50'/><br>
      <div class='floatLeft pLeft-5'>tile#2</div>
    </div>
    
    <div class='pRight-5 fitContBoxRight roundedBox'>
      <img class='floatRight' src='https://via.placeholder.com/50'/><br>
      <div class='floatRight pRight-5'>tile#3</div>
    </div>
    
    <div class='pLeft-5 fitContBoxLeft roundedBox'>
      <img class='floatLeft' src='https://via.placeholder.com/50'/><br>
      <div class='floatLeft pLeft-5'>tile#4</div>
    </div>
    
    <div class='pRight-5 fitContBoxRight roundedBox'>
      <img class='floatRight' src='https://via.placeholder.com/50'/><br>
      <div class='floatRight pRight-5'>tile#5</div>
    </div>
    
    <h4 class='centerText pTop-5'>asdfadsf asdf  asdf asd f asdfvices</h4>
    <div class=''></div>
  </div>
  <!--//Services-->
  <!--Customers-->
  <div class='customers' id='customers'>
    <h1 class='a centerText'>Customers</h1>
    <div class=''></div>
    <div class=''></div>
    <p>jgfjhgfghjf</p>
  </div>
  <!--//Customers-->
  <!--Community-->
  <div class='' id='Community'>
    <h1 class='a centerText'>Community</h1>
    <div class=''></div>
    <div class=''></div>
  </div>
  <!--//Community-->
  <!--Contact-->
  <div class='' id='Contact'>
    <h1 class='a centerText'>Contact</h1>
    <div class=''></div>
    <div class=''></div>
  </div>
  <!--//Contact-->
  <!--About-->
  <div class='aboutUs'>
    <div></div>
  </div>
  <!--//About-->
</>
<!---------------------------------------------------Footer--------------------------------------------------->
<div class='footerBox'>
  <div></div>
</div>

,

当您使用position: fixed;变换元素时,该元素停止发生。因此,您需要弥补导航栏不再占用的高度不足。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


依赖报错 idea导入项目后依赖报错,解决方案:https://blog.csdn.net/weixin_42420249/article/details/81191861 依赖版本报错:更换其他版本 无法下载依赖可参考:https://blog.csdn.net/weixin_42628809/a
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下 2021-12-03 13:33:33.927 ERROR 7228 [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPL
错误1:gradle项目控制台输出为乱码 # 解决方案:https://blog.csdn.net/weixin_43501566/article/details/112482302 # 在gradle-wrapper.properties 添加以下内容 org.gradle.jvmargs=-Df
错误还原:在查询的过程中,传入的workType为0时,该条件不起作用 &lt;select id=&quot;xxx&quot;&gt; SELECT di.id, di.name, di.work_type, di.updated... &lt;where&gt; &lt;if test=&qu
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct redisServer’没有名为‘server_cpulist’的成员 redisSetCpuAffinity(server.server_cpulist); ^ server.c: 在函数‘hasActiveC
解决方案1 1、改项目中.idea/workspace.xml配置文件,增加dynamic.classpath参数 2、搜索PropertiesComponent,添加如下 &lt;property name=&quot;dynamic.classpath&quot; value=&quot;tru
删除根组件app.vue中的默认代码后报错:Module Error (from ./node_modules/eslint-loader/index.js): 解决方案:关闭ESlint代码检测,在项目根目录创建vue.config.js,在文件中添加 module.exports = { lin
查看spark默认的python版本 [root@master day27]# pyspark /home/software/spark-2.3.4-bin-hadoop2.7/conf/spark-env.sh: line 2: /usr/local/hadoop/bin/hadoop: No s
使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams[&#39;font.sans-serif&#39;] = [&#39;SimHei&#39;] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -&gt; systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping(&quot;/hires&quot;) public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate&lt;String
使用vite构建项目报错 C:\Users\ychen\work&gt;npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-