Re: highlighted text in html

by "Comharsa" <comharsa(at)clara.net>

 Date:  Tue, 21 Dec 1999 10:31:26 -0000
 To:  "Blue" <blue(at)bluesarthouse.com>,
"hwg basics list" <hwg-basics(at)hwg.org>
 References:  swbell
  todo: View Thread, Original
> quick question--is there any way to create a look like highlighted text
(ie
> text in a book that has been highlighted with a highlighter marker) with
> html?
> TIA!
> Blue

Hi Blue

There are two ways you could do this.

1. Create a .GIF of the words you want highlighted and put them in at the
right place. You would have to make sure that things like wrapping, vspace
and hspace were set properly to make it look correct but it would be
viewable by all browsers that support images.

2. Use the CSS property background-color. In the head section of the page
create a style (use whichever colour you want, this one is black text on a
yellow background) -

<style type="text/css">
<!--
.highlight     {color: #000000; background-color: #FFFF33;}
-->
</style>

Then in the body use the style by adding the following tag around whatever
text you want to highlight.-

<font class="highlight">....</font>

The second method is the more correct way to do it though it will not be
seen by older browsers.

HTH

Brian
comharsa(at)clara.net

HTML: hwg-basics mailing list archives, maintained by Webmasters @ IWA