简体   繁体   中英

How to align a image to a paragraph to the right

    [scrollspy samp[scrollspy][1]le]

now having removed the padding in the about us section, the scrollspy is not aligning to the about us, i need help on how to fix the scollspy while maintaining the picture aligned to the paragraph.

</style>
      </head>
      <body id="#navbar" data-spy="scroll" data-target="navbar" data-offset="10">
          <nav id="#navbar" class="navbar navbar-expand-sm navbar-light bg-light fixed-top">
              <a href="#" class="navbar-brand">
                <img src="logo.png" alt="Logo" style="width:80px;">
              <div class="collapse navbar-collapse">
                  <ul class="navbar-nav ml-auto">
                    <li class="navbar-nav">
                      <a class="nav-link" href="#About Us">About Us</a>
                    </li>
                    <li class="nav-item">
                        <a href="#Services" class="nav-link">Services</a>
                      </li>    
                      <li class="nav-item">
                          <a href="#Porfolio" class="nav-link">Porfolio</a>
                        </li> 
                        <li class="nav-item">
                            <a href="#Contact Us" class="nav-link">Contact Us</a>
                          </li> 


                  </ul>  

                </div>  

Remove the padding-top:85px style attribute from the "About Us" div - that creates a 85px high white space which apparently you don't want.

Also, the h2 in there will have a relatively high default top-margin which also creates white space above the text, so you might want to add margin-top: 0 to that h2 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM