突出显示单词 [英] Highlight Words

查看:77
本文介绍了突出显示单词的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我正在创建一个搜索引擎,搜索SQL中的关键字

数据库并在网页中显示结果。


在结果网页中,我想给出

单词的灰色背景,这些单词被用作搜索的关键词。


我该怎么做?


谢谢,


Miguel

Hello,

I am creating a search engine which searches keywords inside SQL
database and displays the results in a web page.

In the results web page I would like to give a grey background to the
words which were used as Keywords for the search.

How can I do this?

Thanks,

Miguel

推荐答案

shapper写道:
shapper wrote:

你好,


我正在创建一个搜索引擎它搜索SQL中的关键字

数据库并在网页中显示结果。


在结果网页中我想给出灰色背景

用作搜索关键字的单词。


我该怎么做?
Hello,

I am creating a search engine which searches keywords inside SQL
database and displays the results in a web page.

In the results web page I would like to give a grey background to the
words which were used as Keywords for the search.

How can I do this?



当您生成结果页面时,请使用< span class =''search''>将搜索词包装在文本

中; the word< / spanbefore为客户提供结果




在你的css中你可以设置:


.search {

背景颜色:#7f7f7f;

}


-

Dag。


When you generate the result page, wrap the search words in the text
with <span class=''search''>theword</spanbefore serving the result
to the client.

in your css you can then set:

.search {
background-color: #7f7f7f;
}

--
Dag.



" shapper" < md ***** @ gmail.comwrites:
"shapper" <md*****@gmail.comwrites:

我正在创建一个搜索引擎来搜索SQL中的关键字

数据库和在网页中显示结果。


在结果网页中,我想给出

单词的灰色背景,这些单词被用作关键词搜索。


我该怎么做?
I am creating a search engine which searches keywords inside SQL
database and displays the results in a web page.

In the results web page I would like to give a grey background to the
words which were used as Keywords for the search.

How can I do this?



在服务器上,将关键字括在< span class ="关键字"> ...< / span>

元素。如何做到这一点会有所不同,这里的主题是偏离主题的,所以如果你在这个部分遇到麻烦,那么请问哪个组合适合

你正在使用的服务器端技术。


然后在你的样式表中选择适当的样式,例如:


..关键字{

背景颜色:#eee;

}


sherm--


-

西弗吉尼亚人为西弗吉尼亚人提供的虚拟主机服务: http ://wv-www.net

Perl中的Cocoa编程: http://camelbones.sourceforge.net


shapper写道:
shapper wrote:

你好,


我正在创建一个搜索引擎,搜索SQL中的关键字

数据库并在网页中显示结果。


在结果网页中我是你喜欢给用作搜索关键词的

字的灰色背景。
Hello,

I am creating a search engine which searches keywords inside SQL
database and displays the results in a web page.

In the results web page I would like to give a grey background to the
words which were used as Keywords for the search.



l

l


>
>



您可以将单词括在一个范围内:

< span class =" searchterm">这些单词会突出显示< / span>


然后在CSS中使用span.searchterm {background-color:gray;}。


通常的免责声明能够保证用户

会看到这个适用。


Nik

You can enclose the words in a span.:
<span class="searchterm">these words are highlighted</span>

and then use span.searchterm{background-color:grey;} in your CSS.

The usual disclaimers about not being able to guarantee that the user
will see this apply.

Nik


这篇关于突出显示单词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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