开发者

How to link to specify section of a HTML page as: <div id="here"></div>?

I have an UL and I need to link those images to the right section of projects.php: EG:ProjectA.jpg to link >> projects.php <section id="projectA"</section>

<ul>
  <li>
    <a title="View project" href=开发者_运维技巧"projects.php">
      <img alt="" src="ProjectA.jpg" />
      <figcaption>BLABLA</figcaption>
    </a>
  </li>
  <li>
    <a title="View project" href="projects.php">
      <img alt="" src=".jpg" />
      <figcaption>BLABLA</figcaption>
    </a>
  </li>
</ul>
<!--end ul-->


<a href="projects.php#projectA">your link</a>


To link like you want, simply add #sectionname to your anchor href. So in your example:

<a title="View project" href="projects.php#projectA"> 
    <img alt="" src="ProjectA.jpg"/>
    <figcaption>BLABLA</figcaption> 
</a>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜