如何使用html超链接调用特定的div [英] How to call a particular div using html hyperlink

查看:92
本文介绍了如何使用html超链接调用特定的div的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用超链接调用特定的 div 。这是我的代码:

I want to call a particular div using a hyperlink. Here is my code:

 <div id="mainNavPane">
    <ul id="sideSubNav">

        <li><a href="#" class="prim">Individuals</a></li>
        <li><a href="#" class="view">Individuals1</a></li>
    </ul>
</div>

<div id="mainScrollPane">








  <!-- 1-5 -->
  <div id="homeScreen" class="screen">
     <div class="arrowLeft" style="width:50px;"><a class="prev"><img src="../images/btn-ArrowPrev.gif"/></a></div>
    <img src="images/bg-HomeScreen.jpg" height=50px width=50px />
     <div class="arrowRight" style="width:50px;"><a class="next"><img src="../images/btn-ArrowNext.gif" /></a></div>
  </div>

   <!-- 5-10 -->
  <div id="IndividualsScreen" class="screen">
     <h2>Individuals using Breaking Free Online</h2>
     <div class="arrowLeft" style="width:50px;"><a class="prev"><img src="../images/btn-ArrowPrev.gif" /></a></div>
     <div class="screenBody" style="width:460px;">
      <ul>
          <li>If you are struggling to control your drinking or use of drugs, Breaking Free Online
              offers you treatment that is immediate, confidential and effective – even if your
              dependence is severe and has been for a long time </li>
          <li>You can take advantage of the treatment at home or anywhere with an internet connection,
              and at the times that are most convenient for you, because it is available online
              24 hours a day </li>
           </ul>
      </div>
      <div class="arrowRight" style="width:50px;"><a class="next"><img src="../images/btnArrowNext.gif" /></a></div>
  </div>   
    </div>


我想在< a href =#class =prim>个人< / a> div id = individescreen < a href =#class =view> Individuals1< / a> 应该显示时,类似地点击$ c> div id = homescreen

I want to display div id = individualscreen when <a href="#" class="prim">Individuals</a> hyperlink is clicked similarly when the <a href="#" class="view">Individuals1</a> should show div id=homescreen

推荐答案

只需使用#后跟元素的id: href =#个人屏幕

Just use a # followed by the id of the element: href="#individualscreen"

这篇关于如何使用html超链接调用特定的div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆