vendredi 31 mai 2019

How to fix my layout so my nav bar doesn´t hide some content after linking to the desired section

my navbar is set to fixed, but everytime i press on e.g. home, it doesnt scroll to the most top, the site is just a little under the maximum you can possibly scroll to the top, this makes my H1 beeing covered partly by my navbar.

  • Ive tried different settings for my nav bar like static etc.
  • Ive tried to change the padding of my nav bar which didnt helped either.
  • Ive tried to achieve better results with different min heights for the sections, currently its set to 85%

    <!-- Header -->
    <header>
    
    <div id="logo">
        <img src="img/111.jpg"="Kurzwarenmobil">
    </div>
    
    <nav>
    
        <ul>
            <a href="#home"><li>home</li></a>
            <a href="#about"><li>Über mich</li></a>
            <a href="#DasKurzwarenmobil"><li>Das Kurzwarenmobil</li></a>
            <a href="#Kontakt"><li>Kontakt</li></a>
        </ul>
    </nav>
    
    

    Kurzwarenmobil

    H.S. Schneiderbedarf

    html, body{margin: 0; padding: 0; height: 100%; text-align: center;} section { min-height: 85%} a {text-decoration: none;} li {list-style-type: none;}

    header { width: 100%; height: 65px; position: fixed; top:0; left: 0;
    background: #FEFCFB; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) ; z-index: 1; }

    logo {

    width: 140px; float: left; margin: 10px 0 0 -10px }

    home{

    background: url(../img/landing.jpg); background-position: center center; background-size: cover; background-attachment: fixed; }

    home h1 {

    margin: 62px auto 0 auto; font-size: 110px}

    home h2 {

    margin: 50 auto 0 auto; font-size: 25px;

    }

    home img {

    width: 32px; margin-top: 150px; opacity: 0.7; }

    home img:hover {

    opacity: 1; }

    home {min-height: 100%}

I want my Nav bar to Navigate to the most top part of the site, which means that there is no more space to scroll to the top. right now when i click on "home" on the nav bar, half of my H1 is covered by the navbar because it´s not scrolled up enough




Aucun commentaire:

Enregistrer un commentaire