谁把我这个ASP留言板 留言字的内容字体的颜色改白色啊
我的留言版背景是黑色的 我想不改它 但是留言以后字体是黑色 所以就看不到留言的内容了 如果给的可以用马上送分!谢谢各位达人了(代码发不完全被我删了一点)
------------------------------------------------
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%option explicit%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>留言薄.</title>
</head>
<%
dim connstr,conn,db
db="123.mdb"
set conn=server.createobject("adodb.connection")
connstr="provider=microsoft.jet.oledb.4.0;data source="&server.mappath(db)
conn.open connstr
%>
<%
if request.form("action")="add" then
call add()
end if
if request.querystring("action")="del" then
call del()
end if
sub add()
dim nname,word
nname=replace(replace(trim(request.form("nname"))," ",""),"'","''")
nname=replace(replace(nname,"<","<"),">",">")
word=replace(trim(request.form("word")),"'","''")
word=replace(replace(replace(replace(word,"<","<"),">",">"),chr(13),"<br>")," "," ")
if nname="" then
response.write("请输入姓名!")
response.end()
end if
if word="" then
response.write("请输入内容!")
response.end()
elseif len(word)>5000 then
response.write("限5千字!")
response.end()
end if
dim cm
set cm=server.CreateObject("adodb.command")
cm.activeconnection=conn
cm.commandtype=1
cm.commandtext="insert into yx (name,word) values ('"&nname&"','"&word&"')"
application.Lock()
cm.execute
application.UnLock()
set cm=nothing
conn.close
set conn=nothing
response.redirect("insert.asp")
end sub
sub del()
dim id
id=request.QueryString("id")
if id=0 then
application.Lock()
conn.execute( "delete from yx")
application.UnLock()
else
if not isnumeric(id) or id="" then
response.clear()
response.write("非法请求!")
response.end()
end if
application.Lock()
conn.execute("delete from yx where id="&id)
application.UnLock()
end if
response.redirect("insert.asp")
end sub
%>
<body background=./image/bk.jpg bgColor=#000000 leftMargin=0 topMargin=0>
<h2 align="center">留言薄</h2>
<a href="#ly">我要留言</a>
<a href="insert.asp?id=0&action=de" onclick="return confirm('期待你下次的到来!')">谢谢来访</a>
<hr size="2">
<%
dim rs,sql,nname,word,id
sql="select * from yx order by id desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof then
response.write("没有留言!")
end if
do while not rs.eof
nname=rs("name")
word=rs("word")
id=rs("id")
response.write ("留言人: "&nname&"<br>")
response.write ("留言内容:"&word&"<br>")
response.write ("<a href=insert.asp?id="&id&"&action=del onclick=""return window.confirm('YES')"">------</a><br><br>")
rs.movenext
loop
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
请你找到这段代码:
<body background=./image/bk.jpg bgColor=#000000 leftMargin=0 topMargin=0>
这里定义了背景为图片和背景色彩为黑色。
简旅历单的修改为如下:
<body background=./image/bk.jpg bgColor=#000000 text="#FFFFFF"leftMargin=0 topMargin=0>或
<body background=./image/bk.jpg bgColor=#000000 style="color:#FFFFFF"leftMargin=0 topMargin=0>
也就是在body体拆谈搜里加入text="#FFFFFF"或style="color:#FFFFFF"
也可以用楼上所说写出样式表。就用我这个简单的侍穗吧
<title>留言薄.</title>键察
语句下面派仔加上这个试试吧尘亮汪
<basefont color="white">
一.写一个HEAD中的样式。
<head>
<style>
a:link{color:#FFFFFF;text-decoration: none;}
a:visited{color:#FFFFFF;text-decoration: none;}
a:hover {color:#FF0000;text-decoration: none;}
a:active {color:#FF0000;}
p,td{font-color:#FFFFFF;font-size:12px;}
</style>
</head>
二.写一个CSS样式表
新建一个css.css(用记事本打开即可)
body{font-color:#ffffff}
然后想要显示留言的页面中旅蚂添加以下:
<head>
<拆笑埋link href="css.css" rel="stylesheet" type="text/css">
</升模head>
这样就可以了 。
把下面这段代码租闭放到<head></head>里面
<style>
a:link{color:#FFFFFF;text-decoration: none;}
a:visited{color:#FFFFFF;text-decoration: none;}
a:hover {color:#FF0000;text-decoration: none;}
a:active {color:#FF0000;}
p,td{font-color:#FFFFFF;font-size:12px;}
<带埋/style>蠢型蚂