HTML关键词

HTML关键词,第1张

border:边框

margin:外边距

width:宽

height:高

padding:内边距

top、bottom、left、right:上、下、左、右

overflow:内容溢出文本框时的处理方法

font:文字

text-decoration:none;去掉连接的下滑线

overflow:visible;(默认值,内容不会被修剪,会呈现在元素框之外)/hidden;(内容会被修剪,并且其余内容是不可见的)/scroll;(内容会被修剪,但是浏览器会显示滚动条一边查看其余内容)/auto;(如果内容被修剪,则浏览器会显示共东条以便查看其余的内容)

list-style:none;去掉li标签前面的点

行内元素:span;

position:定位

clear:left;(在左侧不允许浮动元素)/right;(在右侧不允许浮动元素)/both;(在左右两侧均不允许浮动元素)/none;(默认值,允许浮动元素出现在两侧)

list-style:none;去掉li标签前面的点

HTML:target="_blank":在新的窗口打开浏览器

cursor:鼠标经过时显示的鼠标光标

opacity:0-1:透明度

楼主,给你一段ASP站内搜索关键词着色的代码。你看一下就明白怎么来实现了!

<!--#include file="conn.asp"-->

<!------------------------------------

Asp站内搜索的关键字上色!

------------------------------------->

<head>

<meta http-equiv="Content-Type" content="text/htmlcharset=gb2312" />

<title>设计自己的搜索网站</title>

<style type="text/css">

<!--

body,td,th {

font-size: 12px

}

-->

</style>

<script type="text/javascript">

function Checktext()

{

if (document.from.text.value.length == 0 )

{

alert("搜索关键字不能为空!")

document.from.text.focus()

return false

}

return true

}

</script>

</head>

<body>

<form action="?act=search" name="from" method="post" onClick="return Checktext()">

<input name="text" type="text" id="text" />

<input type="submit" name="Submit" value="搜索" />

</form>

</body>

</html>

<%

function FontToColor(Str)

'定义一个字符转换的过程

if not isnull(str) then

str = replace(str,request("text"),"<font color=red>"&request("text")&"</font>")

'转换str中符合request("text")的字符为 <font color=red>字符</font>

FontToColor = str

end if

end function

if request("act")="search" then

set rs=server.CreateObject("adodb.recordset")

rs.open"select * from list where text like '%"&request("text")&"%' order by time desc",conn,1,1

if rs.eof and rs.bof then

response.write"没有记录!"

response.end

else

do while not rs.eof

response.write"<table width='600' border='0' cellspacing='0' cellpadding='0'><br><tr width='600'><td>"

response.write FontToColor(rs("text"))

'查找rs("text")中包含的request("text")字符,并替换

response.write"</td></tr>"

rs.movenext

loop

rs.close

set rs=nothing

end if

end if

%>


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/6259865.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-03-19
下一篇 2023-03-19

发表评论

登录后才能评论

评论列表(0条)

保存