This article describes how to create customized hyperlinks
by using cascading style sheets (CSS).
NOTE: This article uses customized cascading style sheets that may not
be available in all browsers.
For
more information about this topic, click
Microsoft FrontPage Help on the
Help menu, type
compatibility in the Answer
Wizard, and then click
Search to view the topic.
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
NOTE: You may receive an error message if you copy the examples
directly from this article and paste them into FrontPage. The angle brackets
(< and >) may appear as escaped HTML code (< and >). To work around
this behavior, paste the script into a blank Notepad document, and then copy it
from Notepad before you paste it into FrontPage.
Create Designer Hyperlinks by Using Cascading Style Sheets
The following examples demonstrate how to use customized settings
of cascading style sheets to create personalized hyperlinks.
Example 1: Only Underlines Are in Color
This example allows the hyperlink text color to be the same as
the text color of the document. Only the line under each hyperlink should
appear in a different color.
- Create a new page in FrontPage.
- Insert the following code in the <HEAD></HEAD>
section of the page:
<style>
body { color: black; background-color: white; font-family: arial }
a { color: black; text-decoration: none; border-bottom-style: solid; border-bottom-width: 1px }
a:link { border-bottom-color: blue }
a:visited { border-bottom-color: purple }
a:hover { border-bottom-color: green }
a:active { border-bottom-color: red }
</style>
- Insert the following code in the <BODY></BODY>
section of the page:
<p>Please see <a href="http://www.microsoft.com">http://www.microsoft.com</a> for more.</p>
<p>Please see <a href="http://www.msn.com">http://www.msn.com</a> for more.</p>
- View the page in Microsoft Internet Explorer 4.0 or later.
The underlines for the hyperlinks should be in a different color from the
text.
Example 2: Hover Buttons
This example creates solid hover-style buttons.
- Create a new page in FrontPage.
- Insert the following code in the <HEAD></HEAD>
section of the page:
<style>
body { color: black; background-color: white; font-family: arial }
a { text-decoration: none; padding: 3px }
a:link { color: white; background-color: blue }
a:visited { color: white; background-color: purple }
a:hover { color: white; background-color: green }
a:active { color: white; background-color: red }
</style>
- Insert the following code in the <BODY></BODY>
section of the page:
<p>Please see <a href="http://www.microsoft.com">http://www.microsoft.com</a> for more.</p>
<p>Please see <a href="http://www.msn.com">http://www.msn.com</a> for more.</p>
- View the page using Internet Explorer 4.0 or later. The
hyperlinks should appear as hover buttons.
Example 3: Outline Buttons
This example creates a special kind of hover button, where a
colored box appears around the hyperlink text, creating an outline effect.
- Create a new page in FrontPage.
- Insert the following code in the <HEAD></HEAD>
section of the page:
<style>
body { color: black; background-color: white; font-family: arial }
a { color: black; text-decoration: none; border-style: solid; border-width: 2px; padding: 2px }
a:link { border-color: blue }
a:visited { border-color: purple }
a:hover { border-color: green }
a:active { border-color: red }
</style>
- Insert the following code in the <BODY></BODY>
section of the page:
<p>Please see <a href="http://www.microsoft.com">http://www.microsoft.com</a> for more.</p>
<p>Please see <a href="http://www.msn.com">http://www.msn.com</a> for more.</p>
- View the page using Internet Explorer 4.0 or later. The
hyperlinks should appear as hover buttons that are boxes around the
text.
Example 4: Alter Text Styles
This example forces all hyperlinks to text that is
non-underlined, italicized, and lowercase. Unvisited links appear in bold text,
and links are converted to uppercase text when a user rests the mouse over the
link.
- Create a new page in FrontPage.
- Insert the following code in the <HEAD></HEAD>
section of the page:
<style>
body { color: black; background-color: white; font-family: arial }
a { text-decoration: none; font-style: italic; text-transform: lowercase }
a:link { color: blue; font-weight: bold }
a:visited { color: purple }
a:hover { color: green; text-transform: uppercase }
a:active { color: red }
</style>
- Insert the following code in the <BODY></BODY>
section of the page:
<p>Please see <a href="http://www.microsoft.com">http://WWW.microsoft.COM</a> for more.</p>
<p>Please see <a href="http://www.msn.com">http://WWW.msn.COM</a> for more.</p>
- View the page in Internet Explorer 4.0 or later. The text
changes styles when you rest the mouse on it.