473,473 Members | 1,814 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

HTML tags to highlight parts of a webpage

KP
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 don't even care if the contents get
replaced by something else, but I care that the structure of the page
be preserved as much as possible.

Things I have already tried.
Commenting the block. This causes significant changes in the structure
of the page. Not very suitable. Also, have to refer to the original
page to see what was highlighted.

Some friend suggested <blink> but this doesn't seem to work all the
time.

I tried <span style="..."> this also doesn't work all the time and it
also seems that I would have to parse the contents of the block to be
highlighted to set the options in <span>. Is there a simpler solution?

Thanks for reading my post. Hope you have some helpful ideas.
Kunal
Jul 20 '05 #1
2 8420
KP wrote:
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 don't even care if the contents get
replaced by something else, but I care that the structure of the page
be preserved as much as possible.
<div>

http://www.w3.org/TR/html401/struct/....html#edef-DIV
Some friend suggested <blink> but this doesn't seem to work all the
time.
No friend of mine.

I tried <span style="..."> this also doesn't work all the time and it
also seems that I would have to parse the contents of the block to be
highlighted to set the options in <span>. Is there a simpler solution?


<span> is an inline element. <div> is a block element.

<div style="background-color: yellow"> for example; or <div
class="highlight">, with the highlight class defined elsewhere.

--
Mark.
Jul 20 '05 #2
KP wrote:
I want to automatically highlight parts of a webpage (make them
standout from the rest of the contents).
Then use stylesheets. For inline content, you can empasize it useing
<strong> or <em> and then style it however you like. For block level
content, you can use a structure like this

<p><em>... entire paragraph here ...</em></p>

Unfortunately there's no semantic structure available that can
empasize (or highlight) entire blocks, but you can use classes. eg. to
highlight a table, you can use:

<table class="important">

or whatever class name you like, and then apply style using a stylesheet.
I don't even care if the contents get
replaced by something else, but I care that the structure of the page
be preserved as much as possible.
What's would be the point if the content got replaced? The reason
for highlighting something is usually because the content has some kind
of importance.
Things I have already tried.
Commenting the block...
What the??? I'm assuming you mean by wrapping the entire block
within <!-- and --> (other than that, I have no idea what you mean).
What on earth would you expect that to do, other than completely remove
the entire contents.
Some friend suggested <blink> but this doesn't seem to work all the
time.
Your friend is a complete /twit/! <blink> is a non-standard,
netscape proprietary element, which, thankfully, IE does not support.
Nor does IE support the 'text-decoration: blink;' property which,
although it is standardised, has too many usability problems because
blinking content can be extremely difficult to read, and violate the web
content accessibility guidelines (WCAG).
I tried <span style="..."> this also doesn't work all the time...


Avoid using inline style attributes, they fail to seperate content
from presentation, which is one of the aims of using stylesheets.

--
Lachlan Hunt
http://www.lachy.id.au/
la**********@lachy.id.au.update.virus.scanners

Remove .update.virus.scanners to email me,
NO SPAM and NO VIRUSES!!!
Jul 20 '05 #3

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

Similar topics

9
by: ihatzi | last post by:
Hey all! I am having a bit of trouble getting this to work. You all are probably familiar with the code that strips HTML tags: $PageText = preg_replace("/<.+?>/","",$WebPage); What I need...
5
by: Donald Firesmith | last post by:
Are html tags allowed within meta tags? Specifically, if I have html tags within a <definition> tag within XML, can I use the definition as the content within the <meta content="description> tag? ...
22
by: Trammel | last post by:
Hi, I am here to request support from anyone that has idea's on cross-browser HTML (Mainly Firefox and IE). My personal website http://trammel.no-ip.info works fine on Firefox but IE decides to...
3
by: Jarod_24 | last post by:
My program (it's a webcrawler) downloads htmlpages and in some cases the html has <script> </script> tags in it that generates parts of the html. How can i interpret this javascript and get the...
7
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 ∑...
1
by: countocram | last post by:
I have big problem, I'm using preg_replace() function for my highlighter function, after searching for particular keyword, once the hightler check box is checked it will highlight the content that...
9
by: loretta | last post by:
This code is just reading html and printing , eventually I want to modify the html. However, the original html contains javascript and the output html contains tags not in the original. $url =...
4
by: Finn Stampe Mikkelsen | last post by:
Hi Is there any way to make the textbox property show html, like a textarea on a webpage would?? I have a webapplication that saves an textarea complete with html tags and everything... ...
0
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...
0
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,...
1
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.