Home > Net >  Direct link to an HTML text
Direct link to an HTML text

Time:10-16

yall!

I want a direct link to one of these texts, but I can't figure it out. What would be a direct link to the second 'Michael Stewart':

<div class="content">   
  
  <section class="project-details">
    <div class="container">
      <div class="project-details-item">
        <div class="row">
          <div class="project-details-info wow fadeInLeft">
            <h3 class="project-details-title">
              Michael Stewart<br> Attorney
            </h3>
          </div>

          <div class="project-details-img col-md-8 col-md-offset-4">
            <img alt="" class="img-responsive" src="img/projects/1-780x668.jpg">
          </div>
        </div>
      </div>
      <div class="project-details-item">
        <div class="row">
          <div class="project-details-info wow fadeInRight">
            <h3 class="project-details-title">
              Michael Stewart<br> Attorney
            </h3>
            
          </div>
          <div class="project-details-img col-md-8">
            <img alt="" class="img-responsive" src="img/projects/1-780x668.jpg">
          </div>
        </div>
      </div>

CodePudding user response:

You would do the following:

Your content fits in the viewport height so it isn't going to jump unless you have more content with an overflow.

Whichever element you want to jump to, you must give it a specific ID which you can only use once, and use that #id as the target for the anchor

<a href="#michaelStew">Jump to Michael</a>

<div class="content">   
  
  <section class="project-details">
    <div class="container">
      <div class="project-details-item">
        <div class="row">
          <div class="project-details-info wow fadeInLeft" id>
            <h3 class="project-details-title">
              Michael Stewart<br> Attorney
            </h3>
          </div>

          <div class="project-details-img col-md-8 col-md-offset-4">
            <img alt="" class="img-responsive" src="img/projects/1-780x668.jpg">
          </div>
        </div>
      </div>
      <div class="project-details-item">
        <div class="row">
          <div class="project-details-info wow fadeInRight">
            <h3 class="project-details-title" id="michealStew">
              Michael Stewart<br> Attorney
            </h3>
            
          </div>
          <div class="project-details-img col-md-8">
            <img alt="" class="img-responsive" src="img/projects/1-780x668.jpg">
          </div>
        </div>
      </div>
<iframe name="sif1" sandbox="allow-forms allow-modals allow-scripts" frameborder="0"></iframe>

  •  Tags:  
  • html
  • Related