li横向排列

0 views
Skip to first unread message

greengnn

unread,
Feb 6, 2006, 12:40:49 AM2/6/06
to Web Coders
<%
db_path = "database/data.mdb"
Set conn= Server.CreateObject("ADODB.Connection")
connstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source="&Server.MapPath(db_path)
conn.Open connstr
%>

<%
Set rs = Server.CreateObject ("ADODB.Recordset")
sql = "Select * from article"
rs.Open sql,conn,1,1
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>links</title>
<style type="text/css">
<!--
ul { padding:0; margin:0; list-style:none;}
li{ margin:2px; float:left; width:100px; list-style:none;border:#eee
1px solid;}
li a{
display:block;
padding:5px;
text-align:center;
color:#666;
text-decoration: none;
}
li a:hover{background:#eee;}
-->
</style>
</head>
<body>
<ul>
<%
if rs.EOF and rs.BOF then
response.write ("暂时还没有文章")
else
Do Until rs.EOF
%>
<!--重复域开始-->
<li><a href="#"><%=rs("site")%></a></li>
<!--end-->
<%
rs.MoveNext
Loop
end if
%>
</ul>
</body>
</html>
<%
rs.close
Set rs = Nothing
conn.close
set conn=Nothing
%>

Reply all
Reply to author
Forward
0 new messages