超链接怎么连接到一个div 10
<%@pagelanguage="java"import="java.util.*"pageEncoding="utf-8"%><%@pageimport="dao.Pi...
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="dao.Picture" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<style type="text/css">
#gallery { width:640px;height:auto;margin:0 auto; position:relative; }
ul#thumbnails { padding:0 0 0 10px; margin:0; list-style:none; }
ul#thumbnails li { float:left; position:relative; top:670px; }
ul#thumbnails li a { height:50px; width:50px; padding:3px; display:block; text-decoration:none; background:#fff; }
ul#thumbnails li a img { width:50px; height:50px; border:0; }
ul#thumbnails li a:hover { background:#fc0; }
ul#thumbnails li.close a:hover { background:#fff; }
#gallery #fullsize { position:absolute; left:0; top:0; height:640px; width:640px; overflow:hidden; }
#gallery #fullsize div { width:640px; height:840px; padding-top:25px; }
#gallery #fullsize div img { display:block; margin:0 auto; border:0; }
</style>
</head>
<body>
<div id="gallery">
<ul id="thumbnails">
<%
List list=(List)request.getAttribute("piclist");
for(int i=0;i<list.size();i++){
Picture pic=(Picture)list.get(i);
%>
<li><a href="#pic<%=i+1%>"><img src="<%=pic.getPath()%>" alt="pic<%=i+1%>" /></a></li>
<%
}
%>
</ul>
<div id="fullsize">
<%
for(int i=0;i<list.size();i++){
Picture pic=(Picture)list.get(i);
%>
<div id="pic<%=i+1%>"><img src="<%=pic.getPath()%>" alt="pic<%=i+1%>" /></div>
<%
}
%>
</div>
</div>
<div style="width:550px;margin:20px auto; clear:both;">
</div>
</body>
</html>
一开始可以连接到div 后来到 jsp 有 <base href="<%=basePath%>"> 点超链接会连接到主页 求高手破解 展开
<%@ page import="dao.Picture" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<style type="text/css">
#gallery { width:640px;height:auto;margin:0 auto; position:relative; }
ul#thumbnails { padding:0 0 0 10px; margin:0; list-style:none; }
ul#thumbnails li { float:left; position:relative; top:670px; }
ul#thumbnails li a { height:50px; width:50px; padding:3px; display:block; text-decoration:none; background:#fff; }
ul#thumbnails li a img { width:50px; height:50px; border:0; }
ul#thumbnails li a:hover { background:#fc0; }
ul#thumbnails li.close a:hover { background:#fff; }
#gallery #fullsize { position:absolute; left:0; top:0; height:640px; width:640px; overflow:hidden; }
#gallery #fullsize div { width:640px; height:840px; padding-top:25px; }
#gallery #fullsize div img { display:block; margin:0 auto; border:0; }
</style>
</head>
<body>
<div id="gallery">
<ul id="thumbnails">
<%
List list=(List)request.getAttribute("piclist");
for(int i=0;i<list.size();i++){
Picture pic=(Picture)list.get(i);
%>
<li><a href="#pic<%=i+1%>"><img src="<%=pic.getPath()%>" alt="pic<%=i+1%>" /></a></li>
<%
}
%>
</ul>
<div id="fullsize">
<%
for(int i=0;i<list.size();i++){
Picture pic=(Picture)list.get(i);
%>
<div id="pic<%=i+1%>"><img src="<%=pic.getPath()%>" alt="pic<%=i+1%>" /></div>
<%
}
%>
</div>
</div>
<div style="width:550px;margin:20px auto; clear:both;">
</div>
</body>
</html>
一开始可以连接到div 后来到 jsp 有 <base href="<%=basePath%>"> 点超链接会连接到主页 求高手破解 展开
3个回答
展开全部
<a href="#a1">跳到a1</a>
<div name="a1" id="a1"></div>
示例:保存下载的代码为HTML,试试就知道了
<a href="#a1">跳到a1</a></p>
<p> </p>
<p> </p>11
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<div name="a1" id="a1">222333</div>
2013-12-11
展开全部
连接到一个DIV?
如果我没理解的错,你说的瞄记?点击一个连接,跳转到当前页面某一行?
如果是的话,给DIV一个name属性例如:
<div name="tiaozhuan">
</div>
<a href="#tiaozhuan">点击我跳转到DIV</a>
当然也有可能是我理解错了!链接到DIV?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2013-12-12
展开全部
<a href="javascript:void(0)" onclick="showDIV()">连接到div</a>然后你在页面的JS函数中声明showDIV()函数完成你要显示div的内容,然后点击就可以显示你的div了,不知道这样显示div是不是你要的那种。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |