473,661 Members | 2,448 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HTML tags to highlight a text in a target page ?

Hello

I would like to have a hypertext link which, when I click on it, leads
to a web page where a certain word is highlighted. Depending on the
link, the same target page would be displayed but with a different
word highlighted.
A bit like the search on google using the "cached" pages

I have looked in several HTML tutorials, but I haven't found the
answer...
It seems possible to do that using php, but my site is hosted on a
server that does not support php...

Does anyone know how to do this with html tags, or where I could find
the answer ?

Thanks a lot
Christophe
Jul 20 '05 #1
3 9282
Christophe Guillon wrote:

I would like to have a hypertext link which, when I click on it, leads
to a web page where a certain word is highlighted. Depending on the
link, the same target page would be displayed but with a different
word highlighted.
A bit like the search on google using the "cached" pages

I have looked in several HTML tutorials, but I haven't found the
answer...
It seems possible to do that using php, but my site is hosted on a
server that does not support php...


What you do is replace in the text you want to output; e.g. 'bla
mykeyword bla' becomes bla '<strong
class="highligh t">mykeyword </strong> bla'.
See this Google highlighter for reference:
<http://textism.com/article/638/>

--
Google Blogoscoped
http://blog.outer-court.com
Jul 20 '05 #2

"Christophe Guillon" <c_*******@yaho o.fr> wrote in message
news:bc******** *************** ***@posting.goo gle.com...
Hello

I would like to have a hypertext link which, when I click on it, leads
to a web page where a certain word is highlighted. Depending on the
link, the same target page would be displayed but with a different
word highlighted.
A bit like the search on google using the "cached" pages

I have looked in several HTML tutorials, but I haven't found the
answer...
It seems possible to do that using php, but my site is hosted on a
server that does not support php...

Does anyone know how to do this with html tags, or where I could find
the answer ?


The HTML in a static page is what it is. You have two means of varying a
page's appearance: server-side code and client-side code. If you don't have
access to PHP or other server-side code generation, then your only choice is
client-side generation, which in turn is only good for clients that run
client-side code. However, if you want to go ahead with this, see

http://gavelcade.com/context-based-d...html?splitting

http://gavelcade.com/context-based-d...ml?highlighted

http://gavelcade.com/context-based-d...ml?punctuation

etc. for a simplistic example.

Jul 20 '05 #3
Christophe Guillon wrote:
Hello

I would like to have a hypertext link which, when I click on it, leads
to a web page where a certain word is highlighted. Depending on the
link, the same target page would be displayed but with a different
word highlighted.


From what you say, I understand you have a set of known links that
should highlight some specific text on known target pages. If I am
right, you could also think of using :target CSS selector, keeping in
mind this is a CSS 3 feature that only last Mozilla/Gecko browsers are
able to render right now.

Basically, you could have your target text properly marked-up in your
target page:
<span class="highligh t" id="hid">exampl e</span>

Then somewhere else you have the following link:
<a href="path-to-target-page#hid">link</a>

Plus the following CSS rule:
..highlight:tar get { background-color: yellow ; }

You can see an example of this at
http://www.relinquiere.com/internals/glossary (each word of the glossary
leads to a highlighted example).
--
Want to spend holidays in France ? Check http://www.relinquiere.com/

Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
5181
by: Markus Ernst | last post by:
Hello I have a regex problem, spent about 7 hours on this now, but I don't find the answer in the manual and googling, though I think this must have been discussed before. I try to simply extract the title and meta tags of a valid HTML page as an array: function extract_html($filename)
2
8452
by: KP | last post by:
I want to automatically highlight parts of a webpage (make them standout from the rest of the contents). These parts could be as small as single image tags, and as large as complex tables, parts of tables etc. What is guaranteed, however, is that the part to be highlighted will always be a complete block. Ideally I would like to is insert a single html tag around this block so that the contents of the block will standout on the page. I...
38
7129
by: | last post by:
I have a script... ----- <SCRIPT language="JavaScript" type="text/javascript"> <!-- function makeArray() { for (i = 0; i<makeArray.arguments.length; i++) this = makeArray.arguments; } function makeArray0() {
2
2871
by: Tim_Mac | last post by:
hi, i have a tricky problem and my regex expertise has reached its limit. i have read other posts on this newsgroup that pull out the plain text from a html string, but that won't work for me because i want to preserve the html, and replace some of the plain text. i basically want to show the user's search terms highlighted in the page, like google does, but i want to do this server side (i have the mechanics of intercepting the html...
7
3270
by: Xah Lee | last post by:
Summary: when encountering ex as a unit in css, FireFox (and iCab) did not take into account the font-family. Detail: http://xahlee.org/js/ff_pre_ex.html Xah xah@xahlee.org ∑ http://xahlee.org/
1
16958
by: since | last post by:
I figured I would post my solution to the following. Resizable column tables. Search and replace values in a table. (IE only) Scrollable tables. Sortable tables. It is based on a lot examples I found on the web. Works in IE and mozilla. http://www.imaputz.com/cssStuff/bigFourVersion.html
0
569
by: Lars Eighner | last post by:
In our last episode, <004f629c$0$10265$c3e8da3@news.astraweb.com>, the lovely and talented mark4asp broadcast on comp.infosystems.www.authoring.html: I have not done this, not even on TV.
4
10105
Dököll
by: Dököll | last post by:
Hey Gang! I thought I had a good idea but then I realized JSF doesn't play that... I am trying to mimick what HTML can do in JSF when using target tags to related to inner HTML pages. In orther to get to a links going smoothly in JSF, on would do: <%@ page contentType="text/html" %> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
0
8341
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8754
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8542
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8630
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7362
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4177
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4343
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.