By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,058 Members | 1,336 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,058 IT Pros & Developers. It's quick & easy.

HTML tags to highlight parts of a webpage

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.